1

I have a custom .aspx web page that I use for browsing files on server. Can I reuse that in MVC? Is there an easy way of doing this? ... or I have to rewrite everithing from scratch. I am prety new to mvc and the page use ajax for refreshing.

Thanks, Radu

1
  • 1
    without being more specific about how your webform page is constructed its difficult to say for 100% sure it will work, but most of the time its no problem. Its mainly if your webform relies too heavily on postback or different events such as Init, Load, Prerender etc. you can get into trouble. But must of the time you can use webforms controls on a MVC page without problems. Commented Jan 3, 2011 at 11:36

1 Answer 1

1

You have to rewrite existing pages from scratch. MVC uses completely different approach then WebForms. You can use both MVC and WebForms pages at one project, when upgrading, but can't use both approaches at one page.

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

6 Comments

of course you can use MVC and Webforms on the same page... both have asp.net as their underlying framework and the main difference is how Webforms have a event lifecycle and postback and MVC has a model bound to its view. Drop a webform control in a MVC view and it will most of the time work just fine!
So Can I add an .aspx web page in my MVC project? Where can I add that?
@Pauli Østerø - Sure, it will show up, but it will probably not work as intended. This is like answering yes to "Can I drive my car without a steering wheel?" Of course you CAN, doesn't mean thing will go smoothly.
@jfar maybe your example is a bit extreme, but saying that MVC is completely different and there is no way of making them play together is just wrong.
@radu i did comment on your question, we need more info about what that webform page contains to be able to give you a thorough answer.
|

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.