ASP.NET 1.0 and 1.1 ProfessionalFor advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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
I have a datagrid with a dropdownbox in it(asp vb net)
I have no problem populating the grid or the dropdown.
My problem is how do i get the value from the selected item of the drop down box?
The HTML tag:
<asp:DropDownList OnSelectedIndexChanged="update_sites" AutoPostBack="true" id=affiliate_list runat="server" />
The Code:
Public sub update_sites(sender As Object, e As EventArgs)
Dim sql As String = "SELECT site_name, site_id from sites where affiliate_id=" & affiliate_list.SelectedValue
..
..
..
end Sub
You'll need to access the DDL from the context of the datagrid item. Off of the item you can find the control, cast it to a DDL then access it's value.