gpt4 book ai didi

javascript - 有没有办法在其他功能之前执行更新面板的更新

转载 作者:行者123 更新时间:2023-11-30 19:32:41 24 4
gpt4 key购买 nike

我正在编写一个 asp.net 网站,所以我想在下拉列表中更改文本以更新面板并执行一个函数,该函数从数据库中获取数据并使用这些数据更新面板所有这些都在 js 中,但是我的面板每次更新都很好,但第一次只更新一次相关信息。

第二次数据在面板更新之前被填充,所以当它更新时它是空的。

 protected void DropDownList1_TextChanged(object sender, EventArgs e)
{
currentPickArea = DropDownList1.SelectedItem.Text;


UpdatePanel4.Update();


if (currentPickArea != DROPLIST_PICK_AREA_START_TEXT)
{

LoadPickPlacesBySelectedPickArea();
if (currentPickArea == "QA_Zone")
{
component.processGetLocationByLocationId(currentPickArea);
}
}


}

初始 View Initial view

使用正确的信息正确更新面板 View View with panel updated correctly with right information

当我尝试进行第二次更新时查看,因此没有从数据库获取信息,因为面板在数据库更改后更新 View when i tried to make a second update so without information get from database because the panel update after changes on the database

我想在更新完成后首先执行更新,或者我知道它会在其余部分之前完成我让程序继续。

最佳答案

据我所知,TextChanged 是一个内部事件,不应使用。将其更改为 SelectedIndexChanged,因为这是确定下拉选择何时更改的正确事件。您还可以尝试将下拉列表的 AutoPostBack 属性设置为 false 并将 EnableViewState 设置为 true

关于javascript - 有没有办法在其他功能之前执行更新面板的更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56277657/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com