问题:警告 1 “System.Web.UI.Page.IsClientScriptBlockRegistered(string)”已过时:“The recommended alternative is ClientScript.IsClientScriptBlockRegistered(string key). http://go.microsoft.com/fwlink/?linkid=14202” H:\网站\JiChen\JiChen\Default.aspx.cs 19 18 JiChen
解决办法:
ClientScriptManager CSM = Page.ClientScript;
string ScriptName = "clientScript";
if (!CSM.IsClientScriptBlockRegistered(ScriptName))
{
string strScript = "<script>\n";
strScript += "function OpenWin(){\n";
strScript += "showModalDialog('WebForm1.aspx','')\n";
strScript += "return false\n";
strScript += "}\n";
strScript += "</script>\n";
CSM.RegisterStartupScript(this.GetType(), ScriptName, strScript);
}
RegisterClientScriptBlock也一样
解决办法:
ClientScriptManager CSM = Page.ClientScript;
string ScriptName = "clientScript";
if (!CSM.IsClientScriptBlockRegistered(ScriptName))
{
string strScript = "<script>\n";
strScript += "function OpenWin(){\n";
strScript += "showModalDialog('WebForm1.aspx','')\n";
strScript += "return false\n";
strScript += "}\n";
strScript += "</script>\n";
CSM.RegisterStartupScript(this.GetType(), ScriptName, strScript);
}
RegisterClientScriptBlock也一样