본문 바로가기

study

radio button event


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="radio.aspx.cs" Inherits="radio" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
      <form id="form1" runat="server">
    <div>
            <asp:Label ID="lable" Text="선택하세요" runat="server" /><br />
            <asp:RadioButton ID="rdo1" Text="rdo1" GroupName="gup" AutoPostBack="true"
                runat="server" oncheckedchanged="rdo1_CheckedChanged" />
            <asp:RadioButton ID="rdo2" Text="rdo2" GroupName="gup" AutoPostBack="true"
                runat="server" oncheckedchanged="rdo2_CheckedChanged" />
            <asp:RadioButton ID="rdo3" Text="rdo3" GroupName="gup" AutoPostBack="true"
                runat="server" oncheckedchanged="rdo3_CheckedChanged" />
            <asp:Label ID="lable1" Text="" runat="server" />
    </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;

public partial class radio : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void rdo1_CheckedChanged(object sender, EventArgs e)
    {
        lable1.Text = rdo1.Text;

    }
    protected void rdo2_CheckedChanged(object sender, EventArgs e)
    {
        lable1.Text = rdo2.Text;
    }
    protected void rdo3_CheckedChanged(object sender, EventArgs e)
    {
        lable1.Text = rdo3.Text;

    }
}

'study' 카테고리의 다른 글

data connection  (0) 2010.12.26
QR코드  (0) 2010.12.25
체크박스  (0) 2010.12.25
변수 공부를 했습니다.  (0) 2010.12.24
공부는 하는데 ㅋ  (0) 2010.12.23