473,472 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to dynamically change page meta tags?

To dynamically change something on an ASP.NET web page a literal control
(and others) can be used. But how can a non-visual element, like a page
meta tag, be changed dynamically?

Thanks for your help.
Nov 18 '05 #1
4 1840
What I've done is make a variable public. Example:

public string metatag="";

Metatag = "<meta keyword=\"golf\">";

..aspx

<%=metatag%>

Hope this helps,

Manit

"Bruce W...1" <br***@noDirectEmail.com> wrote in message
news:3F***************@noDirectEmail.com...
To dynamically change something on an ASP.NET web page a literal control
(and others) can be used. But how can a non-visual element, like a page
meta tag, be changed dynamically?

Thanks for your help.

Nov 18 '05 #2
Manit Chanthavong wrote:

What I've done is make a variable public. Example:

public string metatag="";

Metatag = "<meta keyword=\"golf\">";

.aspx

<%=metatag%>

Hope this helps,

Manit

================================================== =

That works. How interesting. Thanks.

What is this <% =whatever %> notation? I'd like to explore this more.
Is there a name for this? I can't find anything in the documentation.
Nov 18 '05 #3
<%=whatever%> or <% Response.Write("asf") %>

this is inline scripting.

Thanks,

Manit Chanthavong

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4
You can use Response.Appendheader or response.addheader to add your meta tag
or update your meta tags,

For more details, check out this article
http://www.extremeexperts.com/Net/Ar...rSessionTimeou
t.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Bruce W...1" <br***@noDirectEmail.com> wrote in message
news:3F***************@noDirectEmail.com...
To dynamically change something on an ASP.NET web page a literal control
(and others) can be used. But how can a non-visual element, like a page
meta tag, be changed dynamically?

Thanks for your help.

Nov 18 '05 #5

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

Similar topics

3
by: The Pritchard | last post by:
I want the user to be able to save the information displayed on a dynamically created page. When I write a script like the following: <SCRIPT> winNew = window.open("","test");...
3
by: Adrian Parker | last post by:
IE.. Tools -> Internet Options -> Settings Button -> Check for newer versions of stored pages = Never If a user changes thier settings to this, then pages are cached in IE. From what we've...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
3
by: PJ6 | last post by:
Can't find anywhere in the docs that mentions a way to programmatically get a page's meta tag collection. Reflection finds nothing in attributes. Can't find anything in a page instance, either. Are...
82
by: Eric Lindsay | last post by:
I have been trying to get a better understanding of simple HTML, but I am finding conflicting information is very common. Not only that, even in what seemed elementary and without any possibility...
1
by: Miguel Dias Moura | last post by:
Hello, I am adding a MetaTag from my .pasx.vb code: Dim metaTag As New HtmlMeta() metaTag.Name = "Title" metaTag.Content = "My Web Site" Page.Header.Controls.Add(metaTag) Later in my code I...
2
by: Dariusz Tomon | last post by:
Hello How can I build meta tags dynamically? Please provide an example. Thank you Dariusz Tomon
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...
1
Merlin1857
by: Merlin1857 | last post by:
How to search multiple fields using ASP A major issue for me when I first started writing in VB Script was constructing the ability to search a table using multiple field input from a form and...
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
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.