无刷新调用js代码 页面使用无刷新控件,我想在后台调用js代码,打开模态窗口,不知道怎么设置,网上搜罗了一下,但在实际应用中依然不能实现,望高手指点~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "window.showModalDialog(url,window,'dialogWidth=800px;dialogHeight=500px;center=1;')", true); function aa(){ window.showModalDialog(url,window,'dialogWidth=800px;dialogHeight=500px;center=1;');}ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "aa();",true); 你是不是直接把代码贴上去用的。如果是的话,那你得把 window.showModalDialog(url,window,'dialogWidth=800px;dialogHeight=500px;center=1;')", true);这里面参数 url 写上啦。否则显示不出来的。 OK 出来了 ,这样直接写js代码可以,为什么把js代码放到前台他就不执行了呢 贴下我的代码吧:后台代码string ss = "431234"; string js = @"var xxx = function (){ aa('"+ss+@"') } if(document.all) { window.attachEvent('onload', xxx); } else { window.addEventListener('load', xxx , false); }"; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "",js, true);前台代码:function SModalDialog(width, height, url, sendmsg) { var WinSettings = "center:yes;resizable:no;dialogHeight:" + height + "px;dialogWidth:" + width + "px;scroll:auto;"; var Myarg = window.showModalDialog(url, sendmsg, WinSettings); if (Myarg == "refresh") window.location.href = window.location.href; } function aa(obj) { SModalDialog(550, 270, "test2.aspx?key=" + obj + "×tamp=" + new Date().getTime(), null); }这样写的话,就不会弹出模态窗口了,不知道什么原因 算题 要哭了,下面这个编译错误是怎么了啊555555 关于调用外部程序 多线程同步实现 接收数据 MSN 源代码火热下载 简单问题,急急急急..水晶报表的。 大家帮忙起名 求一简单正则表达式 c++和c#的语法转换 ASP.NET应用程序上如何实现树形,有没有这个控件? PCL6 Prin Spool File t读取 dll如何写连接sql server的连接串 windows ce(C#语言) 怎么实现打印功能
"window.showModalDialog(url,window,'dialogWidth=800px;dialogHeight=500px;center=1;')", true);
{
window.showModalDialog(url,window,'dialogWidth=800px;dialogHeight=500px;center=1;');
}ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "aa();",true);
你是不是直接把代码贴上去用的。如果是的话,那你得把
window.showModalDialog(url,window,'dialogWidth=800px;dialogHeight=500px;center=1;')", true);这里面参数 url 写上啦。否则显示不出来的。
string ss = "431234";
string js = @"var xxx = function (){
aa('"+ss+@"')
}
if(document.all)
{
window.attachEvent('onload', xxx);
}
else
{
window.addEventListener('load', xxx , false);
}";
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "",js, true);前台代码:
function SModalDialog(width, height, url, sendmsg) {
var WinSettings = "center:yes;resizable:no;dialogHeight:" + height + "px;dialogWidth:" + width + "px;scroll:auto;";
var Myarg = window.showModalDialog(url, sendmsg, WinSettings);
if (Myarg == "refresh")
window.location.href = window.location.href;
} function aa(obj) {
SModalDialog(550, 270, "test2.aspx?key=" + obj + "×tamp=" + new Date().getTime(), null);
}
这样写的话,就不会弹出模态窗口了,不知道什么原因