Get Selected RadioButton Value of RadioButtonList using C# and ASP.Net



In this article i will describe How to Get Selected RadioButton Value of RadioButtonList into Variable using C# and ASP.Net.


In the Previous articles i explained how to sell products online through my websitehow to create setup of visual studio windows application with databasehow to add paging in gridview of asp.nethow to retrieve value from query string using C# and ASP.Net, what is namespace for arraylist and many more about ASP.Net.

Step 1.

Drag and Drop "RadioButtonList" Control From ToolBox in your .aspx Page. And Add three Items into RadioButtonList.

        <asp:RadioButtonList ID="RadioButtonList1" runat="server">
            <asp:ListItem>Item 1</asp:ListItem>
            <asp:ListItem>Item 2</asp:ListItem>
            <asp:ListItem>Item 3</asp:ListItem>

Step 2.

Also, Drag and Drop "Button" Control on your .aspx page.

Step 3.

Write the below code on "Click" event of the Button for storing Selected RadioButton Value into a string variable.

 string radio_btn_value = RadioButtonList1.SelectedValue;

That's It. Now You can use this variable value wherever you want.

Give your Valuable Comments.
comments powered by Disqus
Follow me on twitter
About Me
Harpreet Singh
I began programming with C++ when i was 17. Then at the middle of my study .NET came. Then I began to read C# and VB.NET. By the time i learnt SQL and ASP.NET, and developed some websites such as news portals that are active now. Currently i am running my own Software company.
More Articles