开发者

Adding classic code behind asp.net page to asp.net mvc 3

I have one asp.net page. I want to add this page to asp.net m开发者_如何学JAVAvc 3. I mean I have one just page and I want to display this page with creating new asp.net mvc 3 project.

I found some similar questions but they didn't work. I created class and transfered code behind part from my original page. Then I created view ,and transfered html part.

I added this line to beginning of my view.

<%@ Page Language="C#" Inherits="Asignment.Views.Shared.View" %>

And my class file start like this;

namespace Asignment.Views.Home.view

//namespace Asignment.Models { public class view:ViewUserControl

My biggest problem is that in class file my code does not recognize fields and variables which are from view. Can you fixed if is there a mistake and can you give some idea.

Thank you very much


Usually there shouldn't be a problem adding a Web Forms page to an MVC project.

You should start by adding a new Web Form from the "Add New Item..." menu in the solution explorer. Make sure you don't add it inside a View Folder.

If this Web Forms page doesn't work, you could start by checking your routing setup in Global.asax.cs. Make sure that routes.RouteExistingFiles isn't set to true.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜