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]
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Nov 22, 2012, 7:02 AM
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;
}
}
}
rasul mohPosted Nov 22, 2012, 3:21 AM
Label1.Text = DropDownList1.Text;
one condition , click dropdownlist and go to properties "AutoPostBack"=Change to "True"
NeelimaPosted Nov 22, 2012, 1:50 AM