Separate controls inside update panel for doing AsyncPostBackTrigger
I have update panel that content check box, textbox, 3 DropDownList with CascadingDropDown extender. When I checked the checked box it should do a AsyncPostBackTrigger and it is working ok but the problem that if I select any thing from DropDownLists then check the box it would cl开发者_开发知识库ear the DropDownLists after doing AsyncPostBackTrigger for the the check box.
any advice how to separate these controls inside update panel for doing AsyncPostBackTrigger??
Do you have viewstate enabled for the page?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableViewState="true" %>
I am not sure how you are binding the datasources, maybe something like this:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
BindLists();
}
private void BindLists()
{
testDropDownList.Items.Add(new ListItem("a", "a"));
testDropDownList.Items.Add(new ListItem("b", "b"));
testDropDownList.Items.Add(new ListItem("c", "c"));
}
In which case the source is only bound on the initial page load. If viewstate is not enabled then the datasource would be null after a postback.
精彩评论