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 8010547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:46:05+00:00 2026-06-04T18:46:05+00:00

A dynamic object Page can be found in System.Web.WebPages.WebPageBase , the abstract class which

  • 0

A dynamic object Page can be found in System.Web.WebPages.WebPageBase, the abstract class which WebViewPage inherits from.

A dynamic object ViewBag can be found in System.Web.Mvc.WebViewPage.

Both can propagate up from a view to it’s layout page.

The other difference I can see is that ViewBag can be used in the Controller, whereas Page is only available in the view. Are there any other differences I should know about?

  • 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-04T18:46:07+00:00Added an answer on June 4, 2026 at 6:46 pm

    Page and ViewBag are dynamic and they are wrapper around dictionaries.

    Page is the dynamic wrapper around PageData dictionary. ViewBag is the dynamic wrapper around ViewData dictionary.

    When talk about differences,

    ViewBag is used to share data between controller and view or even we can use to share data between a main view and partial view. So the ViewBag can be accessed from both the controllers and views.

    Page is a little different thing, it can’t be accessed from controllers and it is used to pass data between a main page and a partial page.

    See an example here of using Page to pass data between a main view and partial view.

    Main.cshtml

    @{
       Page.Name = "Mark;
    }
    
    @RenderPage("DisplayName.cshtml"); // partial view
    

    DisplayName.cshtml

    <p>
    Name: @Page.Name
    </p>
    

    Not that I’m using the RenderPage to render the partial view also the partial view is located in the same directory where the main view is located.

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

Sidebar

Related Questions

I have a DOMstring object, text of some web page which I get from
I want to dynamically query an object with System.Linq.Dynamic . var selectData = (from
I have an application which pulls XAML page paths from a database. I can
I have an anonymous type object that I receive as a dynamic from a
I'm trying to find a object from the has_many collection by dynamic-finders, and then
I want to create image object when user selecting a file from html page.
I'm designing a dynamic web page that loads contents by AJAX, like the wall
I have a defined route that displays a dynamic page: page_show: url: /:domain_slug/:slug class:
After these questions: https://stackoverflow.com/questions/8589315/jsf2-dynamic-template Dynamic ui:include How can I retrieve an object on @WindowScoped?
I have an IEnumerable<KeyValuePair<string,string>> , from which I would like, ideally, an anonymous object

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.