0

We have an intranet system developed using asp.net webforms. We are kind of planning to partly incorporate mvc and such a scenario is as follows,

We would like to generate html documents using mvc (using razor view engine) where the inputs are going to come from a normal asp.net webform (from a form button click or so)

Some pointers or references to tutorials on running these 2 scenarios side by side would help a lot.

2 Answers 2

1

ASP.Net MVC and WebForms postbacks don't mix; the only way to do this would be to use <iframe>s (which is not a good idea).

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

3 Comments

I posted this question while reading through mvc tutorials like crazy so please forgive my ignorance. I was wondering if I could just run the mvc site (with templates to generate my html documents) separately and then call url with object data as querystring from my webform site to generate the documents.
Then you lose the point of WebForms, which is ViewState. If you're WebForms are that flexible, you should just switch to MVC entirely.
Thanks heaps for the inputs. We are actually considering moving to MVC step by step considering the project size so were thinking if we could implement mvc in part of our project and slowly start changing based on that. So you recon there are no elegant ways to implement what I was trying to do eh? Any alternatives? If no then I guess I will pull back from what i was doing and do it using webforms. Thanks again for your advice.
1

I am not sure about your described implementation... however, you could start by re-writing some of your aspx pages using MVC views and just get all the existing code behind into a controller to minimize the creation of new code. You could do this one page at a time until all of your pages are MVC views. Good luck.

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.