.
இந்த வீடியோவில் நாம் ரேடியோ
பட்டன் லிஸ்ட் பற்றி காண இருக்கின்றோம்.
Source code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm5.aspx.cs" Inherits="textboxdemo.WebForm5" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
</asp:RadioButtonList>
<br />
<br />
<br />
<asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Text="Submit" />
<br />
<br />
<br />
<asp:Label ID="lblMessage" runat="server" Text="--"></asp:Label>
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
namespace textboxdemo
{
public partial class WebForm5 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ArrayList col = new ArrayList();
if (!IsPostBack)
{
col.Add("Cat");
col.Add("Dog");
col.Add("parrot");
RadioButtonList1.DataSource =
col;
RadioButtonList1.DataBind();
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
lblMessage.Text = "you selected " +
RadioButtonList1.SelectedIndex + "
:" + RadioButtonList1.SelectedItem.Text;
}
}
}
No comments:
Post a Comment