我對OnClick
事件Button
的這段代碼:運行JavaScript代碼從代碼後面進入的UpdatePanel
if (true) {
ClientScript.RegisterStartupScript(UpdatePanel1.GetType(), "", "show_modal('true');", true);
} else {
ClientScript.RegisterStartupScript(UpdatePanel1.GetType(), "", "show_modal();", true);
}
我定義按鈕作爲一個UpdatePanel
一個TRIGER:
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnEdit" EventName="Click" />
</Triggers>
的功能show_modal
位於包含在ASP頁面中的.js
文件中。
我該如何使這個腳本有效?
看看:http://stackoverflow.com/questions/3341623/asp-net-updatepanel-in-gridview-jquery-datepicker/3341741#3341741 http://stackoverflow.com/questions/13890391/asp -net-web-application-jquery-photoviewer-and-ajaxical-update/13890462#13890462 http://stackoverflow.com/questions/13856717/jquery-accordion-not-re-initiating-after-an-asp-net-回覆/ 13856997#13856997 – Aristos
任何一個幫助? – Soufiaane
[類似問題](http://stackoverflow.com/questions/2864398/javascript-code-inside-updatepanel) - [其他類似問題](http://stackoverflow.com/questions/487269/registering-a-dynamic -javascript-after-an-updatepanels-update) - [和其他類似的問題](http://stackoverflow.com/questions/7844061/running-javascript-after-update-panel-refresh) – adripanico