asp.net dropdownlist databind on init causes data loss
Posted
by
user2191496
on Stack Overflow
See other posts from Stack Overflow
or by user2191496
Published on 2013-10-29T03:46:00Z
Indexed on
2013/10/29
3:53 UTC
Read the original article
Hit count: 135
On which event or how should I bind data to the dropdownlist to avoid selected value overridden?
For some reasons, I can't use "IsPostBack" to bind data only on postback
I've tried binding data on page init, it works ok but when postback, the selected value will be overridden (Loss)
protected void Page_Init(object sender, EventArgs e)
{
this.BindData();
}
protected void BindData()
{
//grab the source of dropdownlist
}
© Stack Overflow or respective owner