Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8768379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:03:06+00:00 2026-06-13T17:03:06+00:00

Say I have 2 pages /NotADefault.cshtml /Views/Default.cshtml Question 1. Now I run it, page

  • 0

Say I have 2 pages

  1. /NotADefault.cshtml

  2. /Views/Default.cshtml

Question 1.

Now I run it, page A always gets called implicitly as start-up default page no matter what I name it.

Page B will only be called when I explicitly call localhost/View/Default. How do I make page B (the one in View folder) my default page?

Question 2.

I also have NotADefaultService.cs and DefaultService.cs. I give each page a Service class at the back. However, when page A is called NotADefaultService.cs never gets called. Only DefaultService.cs gets called when page B is called…

My observation is that only the pages in the View folder will get their back-end service class working. Outside of View folder it doesn’t work.

Combining Q1 and Q2.

How do I:

Option 1. get the backend service class working under / root outside “View” folder?

OR

Option 2. appoint /View/Default.schtml as my default at start-up where the service class can be hit?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:03:06+00:00Added an answer on June 13, 2026 at 5:03 pm

    In ServiceStack:

    • Razor Pages that exist within the /Views/ folder are called View Pages
    • Razor Pages that exist anywhere else are called Content Pages

    The difference between them is that View Pages are Razor views that are used to provide the HTML representations (aka views) for services in much the same way View Pages work for MVC Controllers.

    View Pages cannot be called directly, that’s the role of Content Pages, which can only be called directly, i.e. outside the context of a service (or redirected to, from a service).

    In Razor Rockstars, examples of Content Pages include:

    • /stars/dead/cobain/ which calls the /stars/dead/Cobain/default.cshtml Content Page
    • /TypedModelNoController which calls the /TypedModelNoController.cshtml Content Page

    Whereas examples of View Pages include:

    • /rockstars which matches the /rockstars route on the /RockstarsService.cs and because of the [DefaultView("Rockstars")] attribute, uses the /Rockstars.cshtml View Page

    Default Pages

    For Content Pages the default.cshtml is the index page for a folder. So to set a default page for the root / path, create a /default.cshtml page. An example of this is /default.cshtml home page used in the Reusability demo.

    If you want to use a view page as the Home page, you can set the default redirect to it by adding the AppHost config:

    SetConfig(new HostConfig { 
       DefaultRedirectPath = "/home"
    });
    

    Which would call a service matching the /home route that will use the most appropriate View Page based on the rules laid out in the Razor Rockstars page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

lets say i have two pages links.html & contents.php ... first page contains only
Say that I have an article with multiple pages. Each page has a short
I have a content page(Say.. invoice.aspx) in asp.net application with master pages. The content
in my project say I have three pages as below Default.aspx -> abc.aspx ->
Say I have the following pages: http://www.site.com/folder/page.php?id=89 http://www.site.com/folder/page.php?id=85 http://www.site.com/folder/page.php?id=camel+hump http://www.site.com/folder/page.php?id=76 http://www.site.com/folder/page.php?id=71 http://www.site.com/folder/page.php?id=frog http://www.site.com/folder/page.php?id=62 http://www.site.com/folder/page.php?id=59
Say I have a page that requires to be directed to two different pages
Let's say I have a page that loads pages dynamically. As each page loads
Say my view pages have route helpers like: root_url user_edit_path Now if I change
Lets say that i have 2 pages: index.php and service.php index.php sends an http-post
Lets say I have the following pages: # Include.asp <% Response.Write IsIncluded() & <br>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.