带有更新面板的内容页面不是 运行 javascript?
Content Page with updatepanel not running javascript?
我有一个 gridview,bootstrap 模态位于引用母版页的内容页面上的更新面板内。
我的 gridview 中有 3 列和一个链接按钮。
当 Linkbutton 事件被触发时 javascript 应该被触发,但实际上没有。
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(funct1);
我试过了,但在控制台中出现系统未定义错误。
这是我的代码:
GridView -> 查看按钮 ->
var link = (Control)sender;
GridViewRow row = (GridViewRow)link.NamingContainer;
Label LiD = (Label)row.FindControl("LabelID");
id = Convert.ToInt32(LiD.Text);
Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "funct1()", true)
MandateDetailusingId(id);
也试过
//ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "MyFunction", "funct1()", true);
这是我的 javacript :=
function funct1() {
$('#<%=MandateView.ClientID%>').modal("toggle");
return false;
} // div id="MandateView"
如何弹出模态?一切都在更新面板中。
我终于解决了
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(InitialiseSettings);
function InitialiseSettings(){
// replace your DOM Loaded settings here.
// If you already have document.ready event,
// just take the function part and replace here.
// Not with document.ready
$(element).slideUp(1000, method, callback});
$(element).slideUp({
duration: 1000,
easing: method,
complete: callback});
}
页面上的事件。
多亏了这个link。
我有一个 gridview,bootstrap 模态位于引用母版页的内容页面上的更新面板内。
我的 gridview 中有 3 列和一个链接按钮。
当 Linkbutton 事件被触发时 javascript 应该被触发,但实际上没有。
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(funct1);
我试过了,但在控制台中出现系统未定义错误。
这是我的代码:
GridView -> 查看按钮 ->
var link = (Control)sender;
GridViewRow row = (GridViewRow)link.NamingContainer;
Label LiD = (Label)row.FindControl("LabelID");
id = Convert.ToInt32(LiD.Text);
Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "funct1()", true)
MandateDetailusingId(id);
也试过
//ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "MyFunction", "funct1()", true);
这是我的 javacript :=
function funct1() {
$('#<%=MandateView.ClientID%>').modal("toggle");
return false;
} // div id="MandateView"
如何弹出模态?一切都在更新面板中。
我终于解决了
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(InitialiseSettings);
function InitialiseSettings(){
// replace your DOM Loaded settings here.
// If you already have document.ready event,
// just take the function part and replace here.
// Not with document.ready
$(element).slideUp(1000, method, callback});
$(element).slideUp({
duration: 1000,
easing: method,
complete: callback});
}
页面上的事件。
多亏了这个link。