Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: How to Set !METADESCRIPTION! value on Two Pages

  1. #1
    Tom Cox is offline Senior Member
    Join Date
    Nov 2009
    Location
    Los Angeles, CA
    Posts
    104

    Default How to Set !METADESCRIPTION! value on Two Pages

    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

  2. #2
    Tom Cox is offline Senior Member
    Join Date
    Nov 2009
    Location
    Los Angeles, CA
    Posts
    104

    Default

    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