i am binding a ddl on page_load event, when the page is refreshed, the entries are duplicate.
ex--
India
India
India
Abc
Abc
Abc... and so on..
Loading
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.
Pankaj PandeyPosted Jun 20, 2013, 7:50 AM
{
//BInd here dll.
}
}
Ravi ShekharPosted Jun 20, 2013, 6:56 AM
Use IsPostBack on page_load bcoz it fires only once when page is loaded first time.
page_load
{
if(!IsPostBack)
{
}
}
Sunny SharmaPosted Jun 20, 2013, 6:38 AM
Put a check if it's a postback on page load. Wrap your Page_Load codes inside an if block like this:
----------------------------------------
if(!IsPostBack)
{
//fill the ddl
// other codes go here if required
}
-----------------------------------------
Happy Coding :)
mark this as answer if it helped.
Cheers!
Sanjeeb LenkaPosted Jun 20, 2013, 6:35 AM
Ex:
ddlCountry.Items.Clear();;
after that write the dropdown bind code
put your bind code within
if(!IsPostBack)
{
}
if any problem rply.
if it helped you mark it as answered