views:

18

answers:

1

I have an ASP.NET MVC app and I have a WebForm page I built in the MVC due to a tutorial on how to do something I needed to do, but it was all in WebForm style. Ive tried to figure out how to do the same thing in MVC format but cant figure it out. So I was needing to figure out how to use this page in my MVC app. But when I try to go to the page, it gives me the error "Page cannot be derived from ViewMasterPage unless Page derives from ViewPage." So I had to make a new standard MasterPage also.

The situation is this. I have a search bar located in the MVC ViewMasterPage thats on every page that is derived from it. Once a user submits info in the search bar, it calls the WebForm Search.aspx page and displays the results on the Search.aspx page. I want the URL to be like "http:///search//. The Search.aspx page is located in the root of the project. How would I get the results Im looking for? Thanks!

+1  A: 

You're probably going to want to re-implement that web form in proper MVC. The two can play nice together in the same web app if you know what you're doing, but if you're trying to implement the whole thing in MVC then just sticking with a web forms tutorial for the occasional page is probably going to make the whole thing a lot more difficult to support. (As you've already learned from having to make a second master page.)

Study the tutorials, but make it a point to learn exactly what it is they're doing rather than just copy/paste the code. The actual implementation on your end sounds like it should stay in MVC.

David