How to DropDown list click and display to label?
Dropdown list is click to mouse and display to textbox or label of the list
quick reply
send ans to [email protected]
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Neelima21 reputationPosted Nov 21, 2012, 8:50 PM EST
rasul moh64 reputationPosted Nov 21, 2012, 10:21 PM EST
Label1.Text = DropDownList1.Text;
one condition , click dropdownlist and go to properties "AutoPostBack"=Change to "True"
Satyapriya NayakRank #47 · 31.5K reputationPosted Nov 22, 2012, 2:02 AM EST
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace WebApplication8
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DropDownList1.AutoPostBack = true;
if (!IsPostBack)
{
DropDownList1.Items.Add("a");
DropDownList1.Items.Add("b");
DropDownList1.Items.Add("c");
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
Label1.Text = DropDownList1.SelectedItem.Text;
}
}
}