AppendFormat System.FormatException: 输入字符串的格式不正确
String.Format|StringBuilder.AppendFormat这两个方法用到{0},{1}等来替代,如果本身字符串中包含有{}之类的字符,那么在使用的时候则会出现这样的错误,比如:
script.AppendFormat(@"function chooseOper()
{
var url='chooseOper.aspx?time='+Math.random();
var result=openDialog(url, '', 500, 500, 'status:yes;help:no;scroll:no');
if(result!=null)
{
eval(result);
document.getElementById('{0}').value=selectResult.id;
document.getElementById('{1}').value=selectResult.name;
// alert(selectResult.id+selectResult.name);
}
}
</script>", this.operID.UniqueID, this.operName.UniqueID);