473,326 Members | 2,175 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Dynamic Meta Tags

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
Nov 17 '05 #1
1 1536
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)

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
"Eric Levin" <er**@soundsite.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cezary | last post by:
Hello. I was read PHP manual, but i'm not sure yet. Here is my meta tags in html: <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-2"> <META HTTP-EQUIV="Expires"...
1
by: Darren Blackley | last post by:
Hi there I have documents that I want to automatically add additional meta tags to. The documents already have some meta tags and I want to keep them all together, so I want to add my new meta tags...
19
by: Christian Hvid | last post by:
Hello groups. I have a series of applet computer games on my homepage: http://vredungmand.dk/games/erik-spillet/index.html http://vredungmand.dk/games/nohats/index.html...
4
by: Tim::.. | last post by:
Can someone please tell me why the following dynamic refresh doesn't work! Thanks Inline code... <!----- dynamically filled META REFRESH element -----> <meta id="mtaRefresh" runat="server" />...
6
by: Fred Nelson | last post by:
Hi: I'm developing a new C# Web App and I'm hoping to find a way that I can dynamically generate meta tags for the search engines at the page level. (I want to do this so that I can have someone...
2
by: Dst | last post by:
<head runat="server"> <noscript> <meta http-equiv='refresh' content='0;url=Unsupported.htm'/> </noscript> </head> If i add this to my webform, it redirects to Unsupported.htm if javascript...
16
by: Edward | last post by:
Hi All, I am having huge problems with a very simple dotnet framework web page (www.gbab.net/ztest3.aspx) , it does NOT render correctly under Apple's Safari. The DIV's do not align amd float as...
2
by: thetechturf.com | last post by:
I have some simple dynamic content pages (included below). I need to know how to add specific meta tags (ie. description, keywords, ect.), as well as extra specific header coding to a page. I would...
21
by: karen987 | last post by:
I have a news website, with asp pages. It has publishing software which allows you to add articles in a database, and then calls them up from links etc. I have added dynamic meta tags in 2 parts. The...
5
by: Nick | last post by:
Hi there, I am adding a meta redirect tag to the page dynamically on 2 separate pages in asp.net. One of the pages it works fine, and 5 seconds after the page appears, the redirect occurs. On...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.