安装VS 2013 +净4.5.1后垃圾标签显示MVC的意见了 [英] Garbage tags showing up in MVC views after installing VS 2013 + .Net 4.5.1

查看:147
本文介绍了安装VS 2013 +净4.5.1后垃圾标签显示MVC的意见了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的ASP.Net MVC应用4,有几个地方,我们都可以手动渲染视图为字符串或拦截渲染管线的某些部分。例如:

In my ASP.Net MVC 4 application, there are several places where we are either manually rendering a view to a string or intercepting some part of the rendering pipeline. For example:

    public static string RenderPartialViewToString(Controller controller, string viewName, object model)
    {
        controller.ViewData.Model = model;
        try
        {
            using (System.IO.StringWriter sw = new System.IO.StringWriter())
            {

                var viewResult = ViewEngines.Engines.FindPartialView(controller.ControllerContext, viewName);
                var viewContext = new ViewContext(controller.ControllerContext, viewResult.View, controller.ViewData, controller.TempData, sw);
                viewResult.View.Render(viewContext, sw);
                viewResult.ViewEngine.ReleaseView(controller.ControllerContext, viewResult.View);

                return sw.GetStringBuilder().ToString();

            }
        }
        catch (Exception ex)
        {
            return ex.ToString();
        }
    }

不过,截至今日,与.net 4.5.1安装的Visual Studio 2013 preVIEW后,我们已经注意到,HTML返回到这些功能包括垃圾/调试标签的残局。如以下

However, as of today, after installing the Visual Studio 2013 preview with .Net 4.5.1, we have noticed that the HTML returned to these functions contains a whole mess of garbage/debugging tags. such as the following:

<$A$> <$B$><$C$> <$D$> class="dashboard-content jobs-view active-jobs-view"
<$E$> data-activity-type="<$F$>Active<$G$>"<$H$>> <$I$> <$J$><$K$><$L$> 
class="content-header" <$M$>> <$N$> <$O$><$P$> <$Q$> class="event-carousel-content"
<$R$>> <$S$> <$T$><$U$> <$V$> class="navbar candidate-summary-toolbar"<$W$>> 
<$X$> class="navbar-inner"<$Y$>> <$Z$> class="nav-collapse collapse"<$a$>>

有似乎没有任何韵或理由,他们展现出来,除了按每次一标签增加信。这些标签似乎不正常的页面生命周期中,使其响应流,但 - 只有当我们手动使它们或以某种方式截取管道

There doesn't seem to be any rhyme or reason to where they show up, except that the letter of the tag increases by one each time. These tags don't seem to make it to the response stream during the normal page lifecycle, though - only when we render them manually or intercept the pipeline somehow.

有谁有任何想法这些标签,他们来自,如何摆脱他们?

Does anybody have any idea what these tags are, where they came from and how to get rid of them?

谢谢!

推荐答案

我们正在寻找解决这个,但现在你只需禁用浏览器链接或者通过工具栏按钮,下拉菜单或通过Web设置调试=假。配置。

We are looking at fixing this, but for now you should just disable Browser Link either through the toolbar button dropdown or by setting debug="false" in web.config.

这篇关于安装VS 2013 +净4.5.1后垃圾标签显示MVC的意见了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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