laihailin 2017-11-24 23:48 采纳率: 0%
浏览 1083

网页StringBuilder输出文字丢失,f5调试显示正常

override protected void OnInit(EventArgs e) { /* This page was created by Template Engine at 2017-11-25 6:03:47. 本页面代码由模板引擎生成于 2017-11-25 6:03:47. */ base.OnInit(e); int helpcategorysearch__loop__id=0; int helpsearchbyid__loop__id=0;templateBuilder.Append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n"); templateBuilder.Append("<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n"); templateBuilder.Append(" <head><base href=\"http://localhost/ShopMultiLang.Web/template/skin28/\"></base>\r\n"); templateBuilder.Append("<meta content=\"text/html;charset=utf-8\" http-equiv=\"Content-Type\" /> <title>珠宝展示 - Powered by V5Shop</title>\r\n"); templateBuilder.Append(" <meta content=\"IE=EmulateIE7\" http-equiv=\"X-UA-Compatible\" />\r\n"); templateBuilder.Append(" <meta content=\"text/html;charset=utf-8\" http-equiv=\"Content-Type\" />\r\n"); templateBuilder.Append(" </head>\r\n"); templateBuilder.Append(" <body>\r\n"); templateBuilder.Append("\r\n"); helpcategorysearch__loop__id=0; foreach(DataRow helpcategorysearch_member in getTable("helpcategorysearch","[id]$[name]").Rows) { if(helpcategorysearch__loop__id == 6 && helpcategorysearch__loop__id != 0) break; helpcategorysearch__loop__id++; templateBuilder.Append("<div style=\"padding-right: 40px; float: left; width: 100px; line-height: 25px; text-align: left\"><div class=\"size\"><img alt=\"\" align=\"absMiddle\" src=\"images/bottom/img_1.gif\" /> <b>" + left(helpcategorysearch_member["name"].ToString(),20) + "</b></div>\r\n"); helpsearchbyid__loop__id=0; foreach(DataRow helpsearchbyid_member in getTable("helpsearchbyid","["+helpcategorysearch_member["id"]+"],[id]$[title]").Rows) { if(helpsearchbyid__loop__id == 5 && helpsearchbyid__loop__id != 0) break; helpsearchbyid__loop__id++; templateBuilder.Append("<div style=\"padding-left:7px\"><a target=\"_blank\" href=\"/ShopMultiLang.Web/help.aspx?id=" + helpsearchbyid_member["id"].ToString() + "\">" + left(helpsearchbyid_member["title"].ToString(),12) + "</a></div>\r\n"); } //end loop templateBuilder.Append("</div>\r\n"); } //end loop templateBuilder.Append("\r\n"); templateBuilder.Append(" </body>\r\n"); templateBuilder.Append("</html>\r\n"); Response.Write(templateBuilder.ToString()); //init cache CacheManager testcaching = CacheFactory.GetCacheManager(); if(!testcaching.Contains(Request.Url.ToString())) { testcaching.Add(Request.Url.ToString(), templateBuilder.ToString()); } }

输出内容看图片图片说明---里面图里的文字和下面的调试对比,比如页面显示了分类,而调试显示的是分类帮助,显示文字出现丢失2个字
调试信息:我点f5调试到stringBuilder.tostring()的时候 输出:
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n\r\n

\r\n \r\n \r\n \r\n \r\n
\r\n\r\n\r\n
0px; float: left; width: 100px; line-height: 25px; text-align: left\">
\"\"退换货
\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n
\r\n \r\n\r\n
现在问题是调试到stringbuilder.tostring()的时候正常,但页面浏览器一显示出来就出现文字丢失,各位大侠谁能帮帮小弟
  • 写回答

1条回答 默认 最新

  • wb_snail 2017-11-25 00:47
    关注

    把你controller层的代码贴出来

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog