Dynamic Meta Tags

  • Thread starter Thread starter Eric Levin
  • Start date Start date
E

Eric Levin

I would like to load the Meta Tags in the page from Code:

Currently they don't come up.

The Source that I have:

private void LoadHeaders()

{
DataSet oDs = new DataSet();
oDs = MetaTags_Select("default.aspx");
foreach (DataRow dr in oDs.Tables[0].Rows)
{
string TagName = dr["TagName"].ToString();
string Description = dr["TagDescription"].ToString();
if (TagName == "Title")
PageTitle.InnerText = Description;
else
Response.AppendHeader(TagName, Description);
}
}

The results from the database are brought back into the Dataset, but the
Response.AppendHeader don't seem to work. The title works no problem.

Thanks,

Eric Levin
Sounddogs.com
 
From help for Server.Transfer

If you set preserveForm to true and if the enableViewStateMac attribute of
the <pages> Element configuration element is true, ASP.NET will raise an
exception when Transfer is executed because the view state from the page
that calls Transfer is not valid on the destination page. One of the
preserved form fields on the calling page is the hidden __VIEWSTATE form
field, which holds the view state for the page. When enableViewStateMac is
true, ASP.NET runs a message authentication check (MAC) on the view state of
the destination page when the page is posted back from the client and the
check will fail. For security purposes, you should keep the
enableViewStateMac attribute set to true but there are other methods
available to transfer Forms data. For more information, including
recommended solutions, see article Q316920, "View State is Invalid Error
Message When You Use Server.Transfer" in the Microsoft Knowledge Base at
http://support.microsoft.com.

Note that you could also use Response.Redirect, which already has an
overloaded method for this (a boolean that indicates whether to continue or
stop before throwing the exception)
 
Back
Top