Dynamic Meta Tags

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
 
C

Craig Deelsnyder

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top