Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

asp.net how to write out meta information dynamically

  • 31-01-2007 10:37pm
    #1
    Registered Users, Registered Users 2 Posts: 872 ✭✭✭


    Hi,

    Im trying to write out a unique title, keywords and description in an aspx page depending on the id in the querystring.

    I can add a runat server to the title tag (so i can access in the code behind) but cant add on to the meta tags.

    Any ideas how i could write out these values dynamically ?

    thanks


Comments

  • Registered Users, Registered Users 2 Posts: 2,152 ✭✭✭dazberry


    Page.Header.InnerHtml = "<meta... /><title></title>"; etc...

    D.


  • Registered Users, Registered Users 2 Posts: 872 ✭✭✭grahamor


    Thanks for the reply, i found an easier way to do it though::

    [PHP]<title id="title" runat="server">temp title</title>
    <meta name="description" content="description" id="description" runat="server" />
    <meta name="keywords" content="keys" id="keywords" runat="server" />[/PHP]

    Then in the code behind...

    [PHP]public System.Web.UI.HtmlControls.HtmlGenericControl title;
    public System.Web.UI.HtmlControls.HtmlGenericControl keywords;
    public System.Web.UI.HtmlControls.HtmlGenericControl description;

    title.InnerHtml = "my title";
    keywords.Attributes["content"] = "my keywords";
    description.Attributes["content"] = "my description";[/PHP]


Advertisement