error while running the cookie prog

Reply Forum
Forum postsuma @ 2009-04-16 08:40:06
ReplyReply to
hi
i got an error while running the cookie example prog given in asp.net tutorial. i am using microsoft visual studio 2005. i got an error in this line of code

BodyTag.Style["background-color"] = ColorSelector.SelectedValue;

saying

The name 'ColorSelector' does not exist in the current


please help me to solve this issue

thank u in advance
suma


Forum postWebmaster @ 2009-04-16 08:42:31
ReplyReply to
Hi Suma,

Did you create a DropDownList with the name of "ColorSelector", like in the example? As per the tutorial, it should look something like this:

<asp:DropDownList runat="server" id="ColorSelector" autopostback="true" onselectedindexchanged="ColorSelector_IndexChanged">
        <asp:ListItem value="White" selected="True">Select color...</asp:ListItem>
        <asp:ListItem value="Red">Red</asp:ListItem>
        <asp:ListItem value="Green">Green</asp:ListItem>
        <asp:ListItem value="Blue">Blue</asp:ListItem>
    </asp:DropDownList>











© net-tutorials.com 2006 - 2012

MailContact net-tutorials.com