473,326 Members | 2,680 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.

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 2279
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: 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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
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: 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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
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.