我试图在配置文件中存储一个URL,但是当我从文件中检索URL时它不起作用
以下是我的代码
在web.config中,我有
<add key="URL" value="/NG/Viewer/ViewerSummary.aspx"/>
Run Code Online (Sandbox Code Playgroud)
在我的aspx.cs页面中,我有以下代码
string url = ConfigurationManager.AppSettings["URL"];
string strScript = "window.open(url?QueryID=" + QueryId + "', '_blank','height=650, center:yes, width=800, status=no, resizable= yes, menubar=no, toolbar=no, location=yes, scrollbars=yes, status=no');";
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "strScript", strScript, true);
Run Code Online (Sandbox Code Playgroud)
如果我写上面的代码,窗口不会打开,但是如果我在下面的代码中执行此操作,则会打开窗口.
string strScript = "window.open('/NG/Viewer/ViewerSummary.aspx?QueryID=" + QueryId + "', '_blank','height=650, center:yes, width=800, status=no, resizable= yes, menubar=no, toolbar=no, location=yes, scrollbars=yes, status=no');";
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "strScript", strScript, true);
Run Code Online (Sandbox Code Playgroud)
如何通过将值放入配置文件来打开窗口?
任何帮助表示赞赏.
谢谢.