Monday 27 August 2012

DropdownList and checkbox control in Asp.Net

DropdownList and checkbox control in Asp.Net examples

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click1(object sender, EventArgs e)
{
Label3.Text = "you have selected:" + DropDownList1.SelectedItem.Text;
}
}


checkbox


public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string str = "your choice is:";
if (Apple.Checked == true)
str += Apple.Text+"|";
if (Mango.Checked == true)
str += Mango.Text+"|";
if (Banana.Checked == true)
str += Banana.Text +"|";
if (Graps.Checked == true)
str += Graps.Text +"|";
Label1.Text = str;
if(str=="your choice is:")
Label1.Text = "select choice then submit";
}
}

Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: