473,799 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
+ 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 1856
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***@noDirect Email.com> wrote in message
news:3F******** *******@noDirec tEmail.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.Append header or response.addhea der 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***@noDirect Email.com> wrote in message
news:3F******** *******@noDirec tEmail.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
1727
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"); winNew.document.writeln("Hello World!"); winNew.document.close(); winNew.focus();
3
1450
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 found, you have to use the following Meta tags in the HEAD section to stop it doing it. meta http-equiv="Pragma" content="no-cache" meta http-equiv="Expires" content="0"
6
3383
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 the usual stuff of recreating the usercontrol in the Page Init event. The 'failure' sequence is as follows: - select web form button to display the user control - select user control button, event fires - select web form button to display...
3
2469
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 they not accessible? Paul
82
6358
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 of getting wrong it seems I am on very shaky ground . For example, pretty much every book and web course on html that I have read tells me I must include <html>, <head> and <body> tag pairs. I have always done that, and never questioned it. ...
1
2149
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 might need to change the Content of this MetaTag. How can I do this?
2
1132
by: Dariusz Tomon | last post by:
Hello How can I build meta tags dynamically? Please provide an example. Thank you Dariusz Tomon
21
7712
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 first part is in the inc.header.asp file which is called up on every page. The page itself has the meta tag variable, ie. title, description. They work fine on all pages, except the one below i'm having problems with. Ironically it's the most...
1
7554
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 having the sql statement dynamically built according to the input provided by the user. I have used the method described here hundreds of times it is quick and adaptive. I generally use a frames page for the search, in this way the search is maintained...
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10484
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10228
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7565
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.