how to add new master page in 2.0 ?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Can anybody explains steps involved in adding new masterpage like (_ColumnsThree.cshtml) and (_ColumnsTwo.cshtml) ?

I have an idea of adding master page in MVC but not sure about nop bcz of so many other thing don't want to ruin anything else.

This is what I think, is it ok ? plz make correction if I am wrong

right click on (shared)
add new
Now I see lot of options which one to select? (like - MVC 3 layout razor, MVC 3 master page (ASPX) or view)
Where I get option to select master page of master page ? I think masterpage like (_ColumnsThree.cshtml) and (_ColumnsTwo.cshtml) also have a commond master page (_Root.cshtml).

Help
12 years ago
anybody ?
12 years ago
pepper wrote:
Can anybody explains steps involved in adding new masterpage like (_ColumnsThree.cshtml) and (_ColumnsTwo.cshtml) ?

I have an idea of adding master page in MVC but not sure about nop bcz of so many other thing don't want to ruin anything else.

This is what I think, is it ok ? plz make correction if I am wrong

right click on (shared)
add new
Now I see lot of options which one to select? (like - MVC 3 layout razor, MVC 3 master page (ASPX) or view)
Where I get option to select master page of master page ? I think masterpage like (_ColumnsThree.cshtml) and (_ColumnsTwo.cshtml) also have a commond master page (_Root.cshtml).

Help


There are a couple ways you could do that.  You can oposite click on the folder and select new view.  Again, the options you select in the add view dialogue box will depend on what you want to do with the layout. Another way to create a new layout would be to copy and paste the layout you like in the same folder. You can then rename it and make your changes.  Make sure to rebuild after making a new layout and before making a new controller.

Chad
12 years ago
cboy wrote:
Again, the options you select in the add view dialogue box will depend on what you want to do with the layout.


Would be great chad if you could show little example so all MVC newbie  like me can understand it properly. (Not sure what options to select becz don't know what option does wat.

cboy wrote:
Again, the options you select in the add view dialogue box will depend on what you want to do with the layout. Another way to create a new layout would be to copy and paste the layout you like in the same folder. You can then rename it and make your changes.  Make sure to rebuild after making a new layout and before making a new controller.

Chad


If I copy - paste then first question is,

does these layoutmaster pages have .cs file connected to it ?

if the answer is yes then while copy - paste wat about .cs file related to master page? pasting will only take care of .chtml.

thx
12 years ago
There is no .cs with a layout.  Once you copy and paste the layout you like, then you will rename it.  Rebuild solution.  Create a new controller, then create a new view from the controller that uses the layout that you just made.

Chad
12 years ago
thank U
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.