开发者

How do you force Visual Studio 2008 to generate designer.cs e.g. Whatever.aspx.designer.cs

I have some webforms in an Asp.Net V2.0 generated using Visual Studio 2005 using Web site technolog开发者_如何学Goy

Want to import them in to Visual Studio 2008 set to v3.5 (Asp.Net MVC) - where I use Project technology

I'm using Add > Existing Item - Which brings in Whatever.aspx & Whatever.aspx.cs There is no Whatever.aspx.designer.cs to import

How do you force it to be generated ?


Right-click your aspx file and select Convert to Web Application.


You have to make sure that your project is a Web Application (and not a Website). Then, You can right-click on the file or the project and select "Convert to Web Application". If all goes well, the designer file will be created. If not, then there is a parsing error in the page.

But if you want your project to truly be a MVC application, then you should not be using code-behind files for your webpages (Views), so you need to refactor the codebehind classes into Controllers. See this article why not:

http://stevesmithblog.com/blog/codebehind-files-in-asp-net-mvc-are-evil/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜