Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get the selected value from a dropdown list...

Status
Not open for further replies.

eirikr

Programmer
Oct 31, 2008
15
US
In main.aspx page, i have a drop down list:

<asp:DropDownList ID="ddl" runat="server" DataSourceID="filter_datasource"
DataTextField="status"
DataValueField="status"
AppendDataBoundItems="True"
AutoPostBack="True"
Font-Names="Arial"
Font-Size="8pt">
<asp:ListItem Value="-1" Selected="True">select</asp:ListItem>
</asp:DropDownList> &nbsp;cases.
----------
in my behind code main.aspx.cs, i can see these values:

Response.Write("index: " + ddl.SelectedIndex + "<br>");
Response.Write("item: " + ddl.SelectedItem + "<br>");
Response.Write("value: " + ddl.SelectedValue + "<br>");

My question is how can i print these values in main.aspx;
I had tried <% ddl.SelectedValue; %> ...etc. but it does not work. Please help


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top