VB How-ToAsk your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
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_SelectedInde xChanged1">
</asp:DropDownList>
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."
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.