Reputation: 2386
The Razor WebPages API says to use PageData to store page data and samples in the tutorials also use it to store the page title.
But... you can also add items to Page eg; Page.Title
Which would be the best approach. The API is not clear but considering it doesn't mention 'Page' for storage, would PageData be best?
Upvotes: 2
Views: 1195
Reputation: 30035
PageData is a dictionary. You access items by their index:
PageData["Title"] = "Some value";
Page is the dynamic version which allows you to create arbitrary properties:
Page.Title = "Some value";
Some people don't like "magic strings" and won't use the first version on that basis. I used the second option in my book because it's less typing. Neither is technically better than the other.
Upvotes: 3