Setting the Title and MetaDescription is good for your users and for the ranking of your page in
search engines. The title is used when bookmarking a page, so a clear title helps the user find your
page again. Search engines such as Google and Bing use the title in their evaluation of what the
page is about. They use the text that you set in the MetaDescription (which ends up as a element in the section of the page’s HTML) to present the results to
the user. This means the text you enter there is often your fi rst point of contact with a user that uses a
search engine. As such, it’s an important piece of information. Rather than reusing the Summary property
for this purpose, you could add an additional column (called SearchEngineDescription, for
example) to the Reviews table in the database. You then need to bring this column into the ADO.NET
Entity Data Model by right-clicking the EDMX model diagram in the Entity Designer and choosing
Update Model from Database. Once you’ve added this property to the model, don’t forget to change the
edit pages in the Management section (AddEditReview.aspx or AddEditReviewHandCoded.aspx) so
they support this new property as well. Finally, in the ViewDetails.aspx page you can then assign its
value to the MetaDescription property of the Page class.
Besides the MetaDescription property, the Page class was extended with a MetaKeywords property
in ASP.NET 4. This property works more or less the same as the MetaDescription and enables you to
set the keywords for the page. Although the importance of keywords to influence search engine ranking
is heavily debated (many say they are not used by search engines at all), it can’t hurt to set them.
You could add the keywords to the database and model by following the same steps as outlined for the
SearchEngineDescription property. For a lot more tips on search engine optimization (SEO), consider
getting a copy of Wrox’s Professional Search Engine Optimization with ASP.NET: A Developer’s
Guide to SEO (ISBN: 978-0-470-13147-3).
The ViewDetails.aspx page now performs pretty well; The first time it loads, the item is retrieved
from the database and stored in the cache. On subsequent visits to the page, the database is no longer
accessed but the item is retrieved from the much faster cache.
This chapter showed you some advanced ways to handle data in an ASP.NET web application.
The following chapter shows you how to protect some of this data — for example, the Management
folder — from unauthorized users by implementing ASP.NET security.