Dropdownlist Slected Index Change in Master Page

Posted by Anweshabhowmick under ASP.NET on 6/19/2012 | Points: 10 | Views : 1780 | Status : [Member] | Replies : 3
suppose i have one dowpdown in master page and i want that when user select any item from that dropdown then a postback will occur and the dropdownlist value will not change show the same value as we select. please help me with sample code.




Responses

Posted by: Dineshkumarwin on: 6/19/2012 [Member] Starter | Points: 25

Up
0
Down
If you are binding dropdownlist at Page_Load event check IsPostBack property like

if(IsPostBack==false)
{
ddlSample.DataSource= x;
ddlSample.DataBind();
}

or If you are not using any events related with that dropdownlist just set AutoPostBack property to false

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

Posted by: Anweshabhowmick on: 6/19/2012 [Member] Starter | Points: 25

Up
0
Down
I declare the ddl in master page..and change it through imn master page ddl...but when i go to the next page the value of master page changed..

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

Posted by: Dineshkumarwin on: 6/19/2012 [Member] Starter | Points: 25

Up
0
Down
Make sure that ddl not rebinding.

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

Login to post response