Click here to Skip to main content
15,891,905 members
Articles / Web Development / ASP.NET

Building a Web Message Board using Visual Studio 2008 Part II - Posting messages using Microsoft Word

Rate me:
Please Sign up or sign in to vote.
4.94/5 (41 votes)
31 Dec 2007CPOL23 min read 168.9K   1.3K   122  
This article uses Visual Studio Tools for Office to build a Word Document Template that can be used to post messages to a message board.
<%@ Master Language="C#" ClassName="SiteMaster" %>

<script runat="server">
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        ThemeSelector.DataSource = new System.IO.DirectoryInfo(Request.MapPath("~/App_Themes")).GetDirectories();
        ThemeSelector.DataMember = "Name";
        ThemeSelector.DataBind();
        ThemeSelector.SelectedValue = String.IsNullOrEmpty(Page.Theme) ? "Default" : Page.Theme;
        //Register an hiiden field that gives the ID of the selector control
        //as we don't know what it will be
        this.Page.ClientScript.RegisterHiddenField("ThemeSelectorId", ThemeSelector.UniqueID);
    }

</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Message Board</title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h1>
            <span>Message Board</span></h1>
        <div id="mainControlBar">
            <ul class="LinkList">
                <li><a href="Default.aspx">Home</a></li>
                <li><asp:LoginStatus ID="LoginStatus" runat="server"  /></li>
                <li><a href="Register.aspx">Register</a></li>
                <li><a href="Settings.aspx">Settings</a></li>
                <li><a href="Feed.svc/GetLatestMessages?format=Rss">Rss</a></li>    
                <li><a href="Feed.svc/GetLatestMessages?format=Atom">Atom</a></li>
                
            </ul>
            <div id="themeSelectorPanel">
                <asp:Label AssociatedControlID="ThemeSelector" runat="server" Text="Theme:" CssClass="themeSelectorLabel"
                    AccessKey="T" />
                <asp:DropDownList runat="server" class="ThemeSelector" ID="ThemeSelector" AutoPostBack="true" />
            </div>
        </div>
        <asp:ContentPlaceHolder ID="MainContent" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions