问题环境:注册JS块时。

出错信息:

异常详细信息: System.FormatException: 输入字符串的格式不正确。

出错代码:

行 29:         Page.ClientScript.RegisterClientScriptInclude("frameTab", "~/JS/FrameTab.js");
行 30:         Page.ClientScript .RegisterClientScriptInclude("frame","~/JS/Frame.js");
行 31:         Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
行 32:             "setStyleSheetPath",
行 33:             string.Format(@"JQuery(document).ready(function() {setStyleSheetPath('{0}');});", StyleSheetPath),
 
出错原因:在格式化时对于“{}”特殊字符格式化错误。
解决办法:必须使用{}时可以用{{=={ }}==}

相关文章:

  • 2021-10-26
  • 2022-12-23
  • 2021-12-21
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
猜你喜欢
  • 2022-02-02
  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
相关资源
相似解决方案