0

I appreciate if someone instruct or give me a helpful link in how this 2 technologies work together side by side. In routeing where I get the most difficulties, when I give link a MVC page to Web Form with Web.sitemap datasource it works fine in some cases but except those runat server tags error.

3
  • 1
    blogs.imeta.co.uk/MGodfrey/archive/2009/03/31/663.aspx and packtpub.com/article/mixing-asp.net-webforms-and-asp.net-mvc Commented Jul 30, 2011 at 16:18
  • 1
    You could be (a lot) clearer about what you tried, and what errors that produced. Code is gong to be clearer than English here. Commented Jul 30, 2011 at 16:19
  • Thank you Henk for your comment. The error I am getting is "Control 'MainContent_lv1_Login1' of type 'Login' must be placed inside a form tag with runat=server" in most places where there is runat=server code when I copy and paste the web forms code to a MVC page. Commented Jul 30, 2011 at 16:44

2 Answers 2

2

It doesn't seem to me like you are trying to run webforms side-by-side with MVC. It seems like you want to use Webforms code in an MVC page, which is something very different.

side-by-side means you might have one page that is webforms, and another page that is MVC in the same site. That is doable.

Making Webforms code work in an MVC page is far more tricky, and in most cases won't work. While it's true that you can use the webforms view engine, and even have a code behind with an MVC page, you will find that much of the Webforms infrastructure isn't there. You can't use Viewstate, and most controls rely on viewstate. So you can only use controls that do not rely on Viewstate (there aren't a lot of those kinds of controls).

I think you need to be more clear about what you are trying to do.

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

4 Comments

I have a web form project want to make it work in MVC platform first, then doing the rest.
@Akbar Admg - That means nothing to me. You need to be more specific. I have no idea what you mean by "make it work in MVC platform first".
My very thanks to you for ur comments. I think I have demonstrated it better in the following link stackoverflow.com/questions/6879433/…
@Akbar Admg - that's not helping either. You need to be specific about how you are trying to move your webforms app to mvc. What specifics are you doing, and how are they failing, what error messages you are getting, show some code.. All you're telling us is "it doesn't work". It's like taking your car to a mechanic and saying "it doesn't work". He'll want to know a lot more.
1

From my own experience this is a bad idea. On my team, we are currently in the middle of a migration for a product built in Webforms to MVC, so there are places where we have to deal with this temporarily tell we can successfully rewrite all the Webforms functionality. However, the information in this blog post will be helpful for you, there is a sample project as well.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.