English 中文(简体)
为什么Visual Studio不能预览类似asp.aspx页面的MVC Razor View(.cs.html)页面?
原标题:Why can t Visual Studio preview MVC Razor View (.cshtml) pages similar to asp/aspx pages?

我喜欢使用Razor视图引擎使用ASP.NETMVC 3,但很不好意思承认,在Visual Studio设计器中无法预览页面(.cs.html)会对我的工作效率产生负面影响。

Visual Studio不会预览Razor页面的根本原因是什么?还是只是因为Razor相对较新(并在带外发布),在这种情况下,我们可能会在Visual Studio 2012中预览?

最佳回答

这确实只是Razor如此新颖的一个例子。毫无疑问,预览版将在未来的版本中与Razor配合使用(谁知道呢,也许2010年的服务包会添加这一功能)。然而,正如@marcind所指出的,这是我这边的猜测。。。

问题回答

因为它没有设计器。你可以通过运行它来预览它。

我不同意生产力。在过去,使用ASPX设计器时,我的标记经常被破坏(也许现在更好了)

没有人知道未来是否会有设计师。但根据此页面有可用的解决方法。





相关问题
How to update shared view adminheader.cshtml from a model

I ve added a drop down into my shared adminheader.cshtl view and it needs to be dynamically updated from data from a table. So when I use another view like routeplan.cshtml I load the view from ...

ASP.NET MVC Razor view engine

After reading Scott Guthrie s blog entry about the new Razor view engine for ASP.NET MVC and reading this question comparing the available view engines. Razor seems to address most of the problems ...

Client Id for Property (ASP.Net MVC)

I m trying to do a label for a TextBox in my View and I d like to know, how can I take a Id that will be render in client to generate scripts... for example: <label for="<%=x.Name.ClientId%>"...

Get Current Area Name in View or Controller

How do you get the current area name in the view or controller? Is there anything like ViewContext.RouteData.Values["controller"] for areas?

MVC which submit button has been pressed

I have two buttons on my MVC form: <input name="submit" type="submit" id="submit" value="Save" /> <input name="process" type="submit" id="process" value="Process" /> From my Controller ...

热门标签