使用链接按钮的click事件从Form1
调用服务器端方法Form1 aspx.cs页面代码: -
protected void lnkTakeAction_OnCommand(object sender, CommandEventArgs e)
{
if (e.CommandName == "duplicate")
{
//Some operations conditional
//If condition true
//call javascript method to call a javascript function to open a rad window
ScriptManager.RegisterStartupScript(this, typeof(System.Web.UI.Page), "ABC "ABCPopUp" + ID + "','Tag');", true);
}
}
Form1 aspx javascript代码: -
function ABCPopUp(ID, Tag) {
var oWindow = window.radopen('XYZPage.aspx?ID=' + scoreMethodId + '&Tag=' + mode, 'rdWindowMapping');
oWindow.SetSize(600, 500);
oWindow.Center();
var titleBar = oWindow.GetTitlebar();
$telerik.$(titleBar).parent().hide();
return false;
}
问题面临 - XYZPage没有打开。如果我从javascript调用函数ABCPopUp,同样的功能也有效。但是当我从服务器端调用表单时没有打开。请给出专家意见
答案 0 :(得分:0)
最有可能的是,脚本运行得太早了。您有两种选择: