Subject: visual web developer 2005
Posted By: carswelljr Post Date: 9/13/2006 3:16:42 PM
Good afternoon,
I am writing a web application using visual web developer and while trying to create a dynamic dropdown using the SqlDataSource i am getting these errors when i try to correct either one:
'SqlDataSource1_Selecting' is not a member of 'ASP.testdirectortest_aspx

and

Control 'DropDownList1' of type 'DropDownList' must be placed inside a form tag with runat=server.

Anyone ever seen this before?
Here is the code i am trying to use:
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:test1ConnectionString %>"
              OnSelecting="SqlDataSource1_Selecting" SelectCommand="SELECT [TEST_FACILITY] FROM [Test_Facility_Data]">
          </asp:SqlDataSource>
          <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2"
              DataTextField="TEST_FACILITY" DataValueField="TEST_FACILITY" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged1">
          </asp:DropDownList>

thanks



Reply By: dparsons Reply Date: 9/13/2006 3:27:29 PM
Are you creating the control dynamically?  Normally I would get this error when I created a control dynamically without adding it specifically to Form.Controls() collection...

"The one language all programmers understand is profanity."
Reply By: carswelljr Reply Date: 9/13/2006 3:40:33 PM
Yes,
I just went to the place in my web where i would like the dropdown menu to be, then added and configured the Data Source. once i went to view it in the browser, those were the errors i received.


Go to topic 49485

Return to index page 176
Return to index page 175
Return to index page 174
Return to index page 173
Return to index page 172
Return to index page 171
Return to index page 170
Return to index page 169
Return to index page 168
Return to index page 167