473,246 Members | 1,944 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,246 software developers and data experts.

Write & Format Meta Tags?

Anybody know how to dynamically write the meta tags using code so they are
formatted on a separate line in the HTML source?
Preferred or optimal framework classes that may be used in this regard?

<meta... />
<meta... />
<meta... />
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
Nov 19 '05 #1
4 2274
not sure but you could try to pass a \n\r at the end of each iteration...

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"clintonG" wrote:
Anybody know how to dynamically write the meta tags using code so they are
formatted on a separate line in the HTML source?
Preferred or optimal framework classes that may be used in this regard?

<meta... />
<meta... />
<meta... />
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

Nov 19 '05 #2
Porbably the easiest way would be to add this in the <head></head>
section:

<asp:Literal runat="server" id="metaPlaceHolder"></asp:Literal>

Then in Page_Load you would iterate through whatever dynamic source you
have for your meta tag info and add the html line by line:

this.metaPlaceHolder.Text = "<meta name=\"keywords\" content=\"one, two,
three\">\n";
-----Original Message-----
From: clintonG [mailto:cs*********@REMOVETHISTEXTmetromilwaukee.co m]
Posted At: Wednesday, August 31, 2005 11:52 AM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Write & Format Meta Tags?
Subject: Write & Format Meta Tags?
Anybody know how to dynamically write the meta tags using code so they
are formatted on a separate line in the HTML source?
Preferred or optimal framework classes that may be used in this regard?

<meta... />
<meta... />
<meta... />
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
Nov 19 '05 #3
My last was missing something...

Probably the easiest way would be to add this in the <head></head>
section:

<asp:Literal runat="server" id="metaPlaceHolder"></asp:Literal>

Then in Page_Load you would iterate through whatever dynamic source you
have for your meta tag info and add the html line by line:

this.metaPlaceHolder.Text = "<meta name=\"keywords\" content=\"one, two,
three\">\n\t\t";
this.metaPlaceHolder.Text += "<meta name=\"keywords\" content=\"one,
two, three\">";

The /n add the CrLf and the /t/t adds two tabs to line the tags up.

John

-----Original Message-----
From: clintonG [mailto:cs*********@REMOVETHISTEXTmetromilwaukee.co m]
Posted At: Wednesday, August 31, 2005 11:52 AM Posted To:
microsoft.public.dotnet.framework.aspnet
Conversation: Write & Format Meta Tags?
Subject: Write & Format Meta Tags?
Anybody know how to dynamically write the meta tags using code so they
are formatted on a separate line in the HTML source?
Preferred or optimal framework classes that may be used in this regard?

<meta... />
<meta... />
<meta... />
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
Nov 19 '05 #4
Thanks Curt and John. Consider this...

// HtmlMeta Class [1],[2]
HtmlMeta meta = new HtmlMeta();
meta.Attributes.Add("description", "blah blah blah");
HtmlHead head = (HtmlHead)Page.Header;
head.Controls.Add(meta);

But using that class concatentates the text in the HTML source. You'd think
the persons who wrote that class would have at least considered doing it
right because I haven't determined a trick to work-around yet and it looks
like if we want readable results we will have to resort to the use of a
control in the head element.

<%= Clinton Gallagher

[1] http://msdn2.microsoft.com/library/m...us,vs.80).aspx
[2] http://www.howtoadvice.com/SetMetaTags
"John Horst" <jh****@innovasi.com> wrote in message
news:eJ**************@TK2MSFTNGP09.phx.gbl...
My last was missing something...

Probably the easiest way would be to add this in the <head></head>
section:

<asp:Literal runat="server" id="metaPlaceHolder"></asp:Literal>

Then in Page_Load you would iterate through whatever dynamic source you
have for your meta tag info and add the html line by line:

this.metaPlaceHolder.Text = "<meta name=\"keywords\" content=\"one, two,
three\">\n\t\t";
this.metaPlaceHolder.Text += "<meta name=\"keywords\" content=\"one,
two, three\">";

The /n add the CrLf and the /t/t adds two tabs to line the tags up.

John

-----Original Message-----
From: clintonG [mailto:cs*********@REMOVETHISTEXTmetromilwaukee.co m]
Posted At: Wednesday, August 31, 2005 11:52 AM Posted To:
microsoft.public.dotnet.framework.aspnet
Conversation: Write & Format Meta Tags?
Subject: Write & Format Meta Tags?
Anybody know how to dynamically write the meta tags using code so they
are formatted on a separate line in the HTML source?
Preferred or optimal framework classes that may be used in this regard?

<meta... />
<meta... />
<meta... />
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

Nov 19 '05 #5

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"...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
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...
24
by: Day Bird Loft | last post by:
Web Authoring | Meta-Tags The first thing to understand in regard to Meta Tags is the three most important tags placed in the head of your html documents. They are the title, description, and...
0
by: Phil C. | last post by:
Hi, I'm using Access 2000. I have a Select Query that uses the MID function to separate the actual text of articles from the title of the articles. The articles are enterd into the...
4
by: Mark Rae | last post by:
Hi, Is there a way to prevent ASP.NET 2 from stripping off the self-closing meta tags...? E.g. <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1" /> is turned into
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...
5
by: jhurrell | last post by:
I have been having some trouble getting my XSL style sheet to parse correctly. I have some XML outputted from an SQL-Server, that I then need to turn into multiple HTML files. This I have done...
10
by: jpollack | last post by:
I don't know JavaScript but have been tasked to write a script that will change the value of a Boolean variable to the word "Yes" on a table row. I have been trying to achieve this based on my...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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
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...

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.