输入字符串格式不正确 - 错误 [英] Input string was not in a correct format - error

查看:264
本文介绍了输入字符串格式不正确 - 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我遇到以下错误 - 输入字符串格式不正确,代码如下:

Hi,

I am experiencing following error - "Input string was not in a correct format", on the code below:

if (!IsPostBack)
       {
          JavaScriptSerializer jss = new JavaScriptSerializer();
          ClientScript.RegisterStartupScript(this.GetType(), "TestInitPageScript",
          string.Format("<script type=\"text/javascript\">google.load('visualization','1.0',{'packages':['corechart','controls']});google.setOnLoadCallback(function(){'drawVisualization'({0},'{1}','{2}');});</script>",
          jss.Serialize(GetData()),
          "Text Example",
           "Name,type,"));

       }





任何帮助,非常感谢。谢谢。



Any help, would very much appreciated. Thank you.

推荐答案

{'packages':['corechart','controls']}



内部string.Format {} (花括号)具有特殊含义。如果你想使用它,你必须加倍!


Inside string.Format {} (curly brackets) has special meaning. If you want to use it you have to double it!

{{'packages':['corechart','controls']}}


这篇关于输入字符串格式不正确 - 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆