3 Replies - 6723 Views - Last Post: 20 November 2012 - 04:35 AM

#1 mil1234  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 109
  • Joined: 01-February 09

asp mvc 4 razor

Posted 13 November 2012 - 02:37 PM

Hi Guys,

i am new to asp mvc 4 and razor....how can i change the default template that comes with razor....and if this is possible (and i 'm quite sure it is) is there any place were i can get some free razor templates that has came built in?


Thanks...
Is This A Good Question/Topic? 0
  • +

Replies To: asp mvc 4 razor

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4316
  • View blog
  • Posts: 12,096
  • Joined: 18-April 07

Re: asp mvc 4 razor

Posted 15 November 2012 - 12:45 PM

If you look in the "Views" folder of your project you will see a series of cshtml files. These are views, that is, files for controlling the rendering of the pages. Among them you will see default.cshtml (if you are doing razor through C#). You can edit that page to make it what you want. You can also go into the "settings" of the project and see a "Manage default pages option" for controlling which is the default page. You may have to remove default.cshtml first and then go there and change the page to a new default page.

As for templates you can download, you may find them rare and few in number. This is because most views, or templates, are designed to take advantage of custom code you write using your own Models and controllers. So for instance to use a view that lists movie ratings and pictures, your view would take advantage of Movie objects you created in your models and served to the view via the controllers.

So even if you did find a template, you would have to either make sure all the code for the supporting models and controllers come with it or have to create all that yourself... which is not simply a plug and play type of thing. MVC is for custom work mostly.

Hope that makes sense. :)

This post has been edited by Martyr2: 15 November 2012 - 12:48 PM

Was This Post Helpful? 1
  • +
  • -

#3 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 441
  • View blog
  • Posts: 1,488
  • Joined: 28-April 09

Re: asp mvc 4 razor

Posted 18 November 2012 - 09:07 PM

if you're wanting a template to set the ui for the page then there's really isn't any. A view's look is just all html and css. You define the page just as you would any html document.
Was This Post Helpful? 0
  • +
  • -

#4 mil1234  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 109
  • Joined: 01-February 09

Re: asp mvc 4 razor

Posted 20 November 2012 - 04:35 AM

View PostMartyr2, on 15 November 2012 - 12:45 PM, said:

If you look in the "Views" folder of your project you will see a series of cshtml files. These are views, that is, files for controlling the rendering of the pages. Among them you will see default.cshtml (if you are doing razor through C#). You can edit that page to make it what you want. You can also go into the "settings" of the project and see a "Manage default pages option" for controlling which is the default page. You may have to remove default.cshtml first and then go there and change the page to a new default page.

As for templates you can download, you may find them rare and few in number. This is because most views, or templates, are designed to take advantage of custom code you write using your own Models and controllers. So for instance to use a view that lists movie ratings and pictures, your view would take advantage of Movie objects you created in your models and served to the view via the controllers.

So even if you did find a template, you would have to either make sure all the code for the supporting models and controllers come with it or have to create all that yourself... which is not simply a plug and play type of thing. MVC is for custom work mostly.

Hope that makes sense. :)/>



Thanks for your reply...All i really need are some templates to quick replace the so called 'master page' that came built in asp.net mvc 4? with regards to the changing 'body' dynamic content(the views etc) i will design them myself as those are personalized to each application and no identical layout for them can be downloaded!

tnx again
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1