I would like to set the !METADESCRIPTION! variable on the search.aspx and sitemap2.aspx pages so they don't pick up the app.config default values.
Can anyone help me figure out how to do this?
Thank you,
Tom
I would like to set the !METADESCRIPTION! variable on the search.aspx and sitemap2.aspx pages so they don't pick up the app.config default values.
Can anyone help me figure out how to do this?
Thank you,
Tom
OK, I've got this working now but I have no idea if I did it the best way or not. For those who are interested, Aspdnsf support says it can only be done in code and they wouldn't tell me how without paying them, so I poked around until I figured it out.
In SkinBase.cs I added this code right before !METADESCRIPTION! gets replaced with the contents of the local variable m_SEDescription. I added this:
// Add SE Description replacement here for search.aspx page -tc 5/29/13
String Thispage = HttpContext.Current.Request.Path.Substring(HttpCon text.Current.Request.Path.LastIndexOf("/") + 1, HttpContext.Current.Request.Path.Length - HttpContext.Current.Request.Path.LastIndexOf("/") - 1);
if (Thispage.ToLower().Equals("search.aspx"))
{
m_SEDescription = "My Desired Meta Description";
}
// Added to here.
This works and hopefully doesn't break anything else. This should work for the meta keywords and meta title too.
Hope this is helpful.
Tom