Free Search Engine Submission Search Engine Submission - AddMe ASP.NET Help, ASP.NET Tutorials, ASP.NET Programming, ASP.NET Tricks

Monday, February 15, 2010

Display Dropdown items in textbox

Take the one dropdown list and one textbox
set the both autopostback property=true

public void ddp1_SelectedIndexChanged(object Sender,EventArgs e)
{
txt.Text=ddp1.SelectedItem.ToString()/Text;
}

Simple if condition example in asp.net c#

Private Void button_click(object sender,EventArgs e)
{
if(textname.Text=="abc" && textpwd.Text=="123")
{
lbl.Text="Successfully login";
}
else
{
lbl.Text="sorry ";
}
}


how to display TextBox Value in Label

To Display any any TextBox Value in Label on Button Click Event Here is code

Public Void Button_click (object sender,EventAgrs e)
{
Label1.Text = TextBox1.Text;
}