English 中文(简体)
页: 1
原标题:
  • 时间:2009-08-25 09:43:33
  •  标签:

I face a weird problem. I have a simple aspx page with a dropdownlist. The dropdown gets filled through a function which is called from Page_Load() event. The dropdown item selection triggers event OnSelectedIndexChanged. Now the event triggers rightly but what happens that upon post back the dropdownlist gets initialized, that is, it shows empty. Never faced this type of issue before so i wonder what s happening wrong.

守则如下:

protected void Page_Load(object sender, EventArgs e)
{
     if(!Page.IsPostBack)
        PopulateCompanyList(GetCompanies(serverUNCPath));
    return;
}
问题回答

观点是否在您的退学名单上,或者也许整个应用上都残疾?

第一种想法:

  1. Check EnableViewState property of your dropdown and all the parent controls up to the root (should not be false)
  2. You perform rebinding on postbacks without storing SelectedValue property
  3. If one of your parent controls is custom or dynamic it may incorrectly persist ViewState info (including children).




相关问题
热门标签