473,396 Members | 2,109 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,396 software developers and data experts.

Writing a META tag?

Hi all,

I have the need to write a meta tag to the page BEFORE it loads...

My page does 3 things based on whats passed through in the query string:

1. Receive a file id and check its valid, display "Retrieving file...please
wait.", redirect to same page with altered querystring
2. Based on new querystring value retrieve document details and check its ok
to allow the user to download the file,, display a message to the user
depending on outcome of check either "sorry" and then nothing else happens,
or "Document ready to download" - redirect to same page with altered
querystring
3. Based on new querystring value, transfer file via SA-FileUp..

I did this in old ASP, each "page" was in between the if...then's etc, and
each "page" could have its own "meta refresh" if needed, 2 of them do, one
doesn't....

Now I'm trying to recreate this in a dot net page, I have panels for the
relevant sections, they get turned on/off depending on the
querystring/checks etc, but the meta refresh is a problem as if I add it to
the page in the HTML its therefore all 3 steps and the last one will keep
redirecting, so I need to be able to programmatically write this:

<meta http-equiv="refresh" content="--my duration, page and querstring
would be in here--">

to 2 of my steps based on the querstring values etc...and not on the
last...I managed to do this with a javascript function being called (or not)
with onLoad="" in the html being written based on criteria by setting the
body tag to runat="server" and then adding/removing an attribute but I
cannot do this for the meta tag...

I'm guessing these need to be written before the page renders? But have no
idea how to go about it...

Any help would be appreciated.

Regards

Rob
Nov 19 '05 #1
2 1647

"Rob Meade" <ku***************@edaem.bor> wrote in message
news:ej****************@TK2MSFTNGP10.phx.gbl...
Hi all,

I have the need to write a meta tag to the page BEFORE it loads...

This is how I handle custom metatags. I place a control in between the head
tags. The control contains a placeholder (say it's id is plc1). Then I use
the following type of code to put the meta tag items in the control.

strMetaTag = some_literal_metatag_text
plc1.controls.clear
plc1.controls.add(New Literalcontrol(strMetaTag)

Alternatively, if the tags can be standardized, you could create a control
that contain only metatags and add them to the placeholder.

plc1.controls.clear
dim ctl as control = loadcontrol("/yourmetatag1.ascx")
plc1.controls.add(ctl)

Mike


Nov 19 '05 #2
"vMike" wrote ...
This is how I handle custom metatags. I place a control in between the
head
tags. The control contains a placeholder (say it's id is plc1). Then I use
the following type of code to put the meta tag items in the control.

strMetaTag = some_literal_metatag_text
plc1.controls.clear
plc1.controls.add(New Literalcontrol(strMetaTag)

Alternatively, if the tags can be standardized, you could create a control
that contain only metatags and add them to the placeholder.

plc1.controls.clear
dim ctl as control = loadcontrol("/yourmetatag1.ascx")
plc1.controls.add(ctl)


Hi Mike,

Many thanks for the reply - I plonled a literal in there in the end and then
wrote to that on the page load in the code behind, seemed to work -
marvellous - thanks again for the reply.

Regards

Rob
Nov 19 '05 #3

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"...
7
by: Brian Burgess | last post by:
Hi all, Anyone see anything wrong with the following: *************************************************************** <%@ LANGUAGE="VBSCRIPT" %> <% Option Explicit Dim nAcctNbr Dim...
4
by: Brian | last post by:
Hi, I'm trying to use standard meta tags in an xsl doc and using cocoon as my processor. The problem is that cocoon changes for example: <meta name="keywords" content="test, test, test" /> ...
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...
3
by: J1C | last post by:
How can I programatically add meta tags with javascript?
5
by: RodneyDunes | last post by:
My site did validate and now it doesn't. The error I get is the following: document type does not allow element "META" here ....nt-type" content="text/html;charset=iso-8859-1"> Can someone...
1
by: Maziar Aflatoun | last post by:
Hi everyone, My goal is to modify the contents of my meta tag (html refresh). However, my code adds a new instance of the meta tag at the bottom of the page. Is there a way to modify it instead...
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.