大家帮我看看 这样写法 哪里出错了?帮我改下。。
if (this.hidSetType.Value == "" && this.hidSetType.Value != this.drSetType.SelectedValue)
{
//弹出消息框
string CurrentYearProfitAccout = HttpContext.GetGlobalResourceObject("GL", "GL_3005_14").ToString();
StringBuilder sb = new StringBuilder();
sb.Append(" function(){");
sb.Append(" MessageBox.Confirm('','" + CurrentYearProfitAccout + "',showResult); ");
sb.Append(" function showResult(btn){");
sb.Append(" if(btn=='Yes'){");
PeriodGenerateDocDTO periodGenerateDocDTO = Change(1);
BindEditTable(periodGenerateDocDTO.PeriodTransform);
sb.Append(" }");
sb.Append(" else{");
this.drSetType.SelectedValue = this.hidSetType.Value;
sb.Append(" return false; ");
sb.Append(" }");
sb.Append(" return false; ");
sb.Append("}");
//这边不用管 是正确的
Page p = HttpContext.Current.Handler as Page;
if (!p.ClientScript.IsStartupScriptRegistered("SetType1"))
{
p.ClientScript.RegisterStartupScript(p.GetType(), "SetType1", "(" + sb.ToString() + ")();",true);
}
}
主要是红色的那段 说语法不正确。。。。。。。。。。。。