![]() |
||||
ASP.NET SEO: How to Create Custom Titles and Meta DescriptionsSearch engines use page titles as one of the strongest signals for classifying and ranking pages. Meta descriptions often appear as the search listing's snippet so you want them to be catchy, informative and specific to each page in order to encourage more users to select your listing. If you have a website with many ASP.NET pages generated dynamically, such as a product catalog, it would be a lot of work to add a custom title and meta description to each page by hand. Rather than hand coding, it is often possible to use data that's already available within the web application to set the titles and descriptions. In ASP.NET, this programming can be a bit tricky. Here's some sample code from a project I did. Product.aspx<!-- Replace lblProductTitle with the name of the variable that contains your product title. Make sure the value is set in the code behind page. --> <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><%=lblProductTitle.Text%> » Test.com</title> <meta name="description" content="Get widgets: low prices and free shipping at Test.com" runat="server" id="description" /> Product.aspx.vb'Make sure this import statement appears at the top of the page. Imports System.Web.UI.HtmlControls About the AuthorAfter graduating from Yale with two degrees in Computer Science, Jonathan Hochman set up his own consulting company in 1990. He has been an Internet marketer since 1994. To send feedback, please visit http://www.hochmanconsultants.com/.
For additional information, please contact Hochman Consultants. |
|
|||