what is the difference between ViewData & PageData in asp.net MVC 3?

asp.net-mvc, asp.net-mvc-3, c#, razor

Solution

PageData is a property of WebPages that Razor is built on

[it] Provides array-like access to page data that is shared between pages, layout pages, and partial pages.

http://msdn.microsoft.com/en-us/library/system.web.webpages.webpagebase.pagedata(v=VS.99).aspx

ViewData is a property of ViewPage and provides a method of passing data between a controller and a page.

Gets or sets a dictionary that contains data to pass between the controller and the view.

http://msdn.microsoft.com/en-us/library/system.web.mvc.viewpage.viewdata.aspx

ViewData is accessible via the controller, PageData isn't.

Problem

Well i see this 2 properties but i cant understand the difference between them? I cant seem to find any help anywhere about the PageData propriety. so can any body help? ``` @ { Viewdata["something"] = 1; PageData["something"] = 2; } ``` thanks

Original source

Related problems