Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Writing a META tag?

 
Thread Tools Search this Thread
Old 05-03-2005, 02:41 PM   #1
Default 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




Rob Meade
  Reply With Quote
Old 05-03-2005, 04:15 PM   #2
vMike
 
Posts: n/a
Default Re: Writing a META tag?

"Rob Meade" <> wrote in message
news:ejE6eX%...
> 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






vMike
  Reply With Quote
Old 05-04-2005, 09:36 AM   #3
Rob Meade
 
Posts: n/a
Default Re: Writing a META tag?
"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




Rob Meade
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Complications with installing two DVD writing software in laptop Roy DVD Video 1 08-14-2007 03:09 PM
Cannot read a DVD-RAM disk in my PC recorded by a Panasonic DVD/HDD recorder dkelertas@gmail.com DVD Video 4 05-07-2006 06:00 PM
Cannot erase DVD-RW Terry Pinnell DVD Video 54 10-09-2005 10:14 PM
Alternative DVD encoding & writing software John DVD Video 160 05-05-2005 08:27 PM
Re: Nero - Writing to cache frustration John Tsalikes DVD Video 3 08-09-2003 09:01 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46