i have just startet to learn asp.net and C#
and i have run into a little problem
i have a radiobuttonlist that gets its items from sql,
then i would like to show the item i have selected not the "ID" the "name" it has.
My code
DataSourceID="ObjShipping" DataTextField="ShippingMethod"
DataValueField="ShippingMethodID" AutoPostBack="True">
OldValuesParameterFormatString="original_{0}" SelectMethod="GetShippingMethod"
TypeName="DataSet1TableAdapters.FL_ShippingMethodTableAdapter">
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Akkiraju IvaturiPosted Jan 22, 2013, 10:47 AM
Add a button in the form and on the server side, write event handler for the button in the Page_Load event:
button.click += new EventHandler(button_click);
In the method button_click(object sender, EventArgs e)
{
label.text = RadioButtonList1.SelectedItem.ToString();
}