0

Even I installed asp_regiis . I am using Visual Studio 2008 v3.5
I am facing an issue while building a web project.

I have added the controls in the design window as

<td align="left" valign="top">
                                        <asp:DropDownList ID="ddlCategory12" runat="server" CssClass="dropDownList" AutoPostBack="true" OnSelectedIndexChanged="ddlCategory12_SelectedIndexChanged">
                                            
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" InitialValue="----Select----"
                                            CssClass="validator" ErrorMessage="Please Select Category" ValidationGroup="advSearch"
                                            ControlToValidate="ddlCategory12"></asp:RequiredFieldValidator>
                                    </td>

In the Code behind c# file, In page_Load

ddlCategory1.Items.Clear();

I am getting an error as

Error 1 The name 'ddlCategory1' does not exist in the current context C:\Documents and Settings\224226\My Documents\Visual Studio 2008\Projects\test\BulkUpload.aspx.cs 46 13 XXXX

can anybody help me to solve this issue

Thanks,
Sanbal

Edited by Ezzaral: Fixed broken tags.

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by sanbal
0

Sorry the design code is

<td align="left" valign="top">
                                        <asp:DropDownList ID="ddlCategory1" runat="server" CssClass="dropDownList" OnSelectedIndexChanged="ddlCategory1_SelectedIndexChanged"
                                            AutoPostBack="true">
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" InitialValue="----Select----"
                                            CssClass="validator" ErrorMessage="Please Select Category" ValidationGroup="advSearch"
                                            ControlToValidate="ddlCategory1"></asp:RequiredFieldValidator>
                                    </td>

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.