visibity of textbox by selecting dropdownlist

Posted by Saritha.rajeshkumar under C# on 4/26/2011 | Points: 10 | Views : 1582 | Status : [Member] | Replies : 2
i used array for dropdownlist when i select particular value in dropdownlist the textbox should dissappear.




Responses

Posted by: Ndebata on: 4/26/2011 [Member] Starter | Points: 25

Up
0
Down
Hi

You can use selected index changed event for this. Please take a look at the attached sample.
 Download source file

Saritha.rajeshkumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Tijut2k on: 4/26/2011 [Member] Starter | Points: 25

Up
0
Down
First Set the Dropdownlist property as AutoPostback=true;

aspx code
---------
<asp:DropDownList ID="ddlSearch" runat="server" Width="100px" AutoPostBack="True"
onselectedindexchanged="ddlSearch_SelectedIndexChanged">


C# Code
--------
protected void dropdown_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlSelection.SelectedValue == "0")
{
txtAccountno.Visible = true;

}
else

{
txtAccountno.Visible = False;
}
}

Best Regard's
Tiju Thankachan

Saritha.rajeshkumar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response