views:

112

answers:

5

I want to merge a sidemenu.aspx on another (Home.aspx, Phone.aspx, Car.aspx... etc) page. How do I do that?

A: 

Your question is so confising, please put more details, but as I can see this will solve your problem: How to Merge ASP With HTML

Nathan Campos
Sorry about that. My side menu bar redirects to various aspx pages. I want to keep the side bar and have the pages change in the main window
See that link...
Nathan Campos
+2  A: 

You're a little vague, but I believe you're looking for Master pages, and ContentPlaceHolder controls. The default website when creating a ASP.NET MVC application is set up with some default ones.

Agent_9191
also, something like "sidemenu.aspx" should probably be "sidemenu.ascx" i.e. a control and not a page
David Archer
A: 

In MVC, You can embed a page into another with a function in the "mvc futures" libraries

In your general page you would have:

<% Html.RenderAction("Index", "SideMenu"); %>

Which will call the action "Index" of the controller "SideMenu" that would return the view "sidemenu.aspx"

This could be added to the master page Agent_9191 is talking about!

Mike Gleason jr Couturier
A: 

While you probably should have a Master Page that can contain your sidebar (this is how I do things), you could also have sidebar as a View User Control, which can be rendered using the Html.RenderPartial helper method.

foxxtrot
A: 

I had to merge webforms pages with an asp.net mvc page a few months ago. The most seamless and easiest way I found to do it was using an iFrame:

<iframe src="/path/to/file.aspx" frameborder="0" width="970" height="970">
</iframe>

It looks like its just part of the site, and the aspx postbacks/viewstate worked perfect with no other changes to asp.net required!

reach4thelasers