Speed up development with full-stack environments for every branch.

Learn More

ASP.net How to use Radiobutton List

16860 Runs 150875 Views 59175 Copies
Saved

Saved

invincibleideas 20

invincibleideas
published 4 years ago

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="index" %>
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>ASP.net How to use Radiobutton list control</title>
    <style type="text/css">     
     div
     {
         margin:5px;
     }
    </style>
</head>
<body>
    <form id="form1" runat="server">
     <div>        
        <fieldset>
            <h3>How to use Radiobutton list control</h3>
            <div>
            <asp:RadioButtonList ID="rbtLstRating" runat="server" 
                RepeatDirection="Horizontal" RepeatLayout="Table">
                <asp:ListItem Text="Excellent" Value="Excellent"></asp:ListItem>
                <asp:ListItem Text="Very Good" Value="Very Good"></asp:ListItem>
                <asp:ListItem Text="Good" Value="Good"></asp:ListItem>
                <asp:ListItem Text="Fair" Value="Fair"></asp:ListItem>
                <asp:ListItem Text="Bad" Value="Bad"></asp:ListItem>
            </asp:RadioButtonList>            
            </div>
            <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
        </fieldset>        
         <fieldset>
            <h3>Selected Rating:</h3>
            <div>
                <asp:Label ID="lblSeletedRating" runat="server"></asp:Label>
            </div>
        </fieldset>        
    </div>
    </form>
</body>
</html>

Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).