0

I've been searching how to add webforms to MVC project but there lots of sites explaining only how to add MVC to an existing webforms project.

Is there a way to do that ? Maybe need to add some code at Web.Config ? The .aspx.cs can't find any control on the .aspx webpage, that's the trouble !

Thanks!

2
  • 1
    Could you elaborate on your reasoning behind wanting to do this? The reason what you are finding is usually adding MVC to WebForms is because you're trying to ultimately move to ASP.NET MVC? Not the other way around. Commented Jan 20, 2010 at 18:20
  • I did that because I have a framework in Webforms and to speed up my web development, I had to use it on my MVC. Well, I moved the folder to my project, so I guess that was the reason my .aspx.cs wasn't finding my controls .. I copy+paste code, now It's working .. Commented Jan 20, 2010 at 18:29

2 Answers 2

1

You can add a WebForm to your MVC project and have it work. You can also add WebForm controls to an MVC view as long as you have a <form runat="server"> around it.

Sign up to request clarification or add additional context in comments.

1 Comment

As jamesaharvey said I'd like to know the reason. Can you explain why you want to do this? There's most likely a better way.
1

It irks me to post this ... but I went Add New Item ... and added an Ajax Web Form into an MVC 2 project and the code behind was added and linked to the web form.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.