How to dynamically change page meta tags?

B

Bruce W...1

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.
 
M

Manit Chanthavong

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

public string metatag="";

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



..aspx

<%=metatag%>

Hope this helps,

Manit
 
B

Bruce W...1

Manit said:
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.
 
M

Manit Chanthavong

<%=whatever%> or <% Response.Write("asf") %>

this is inline scripting.



Thanks,

Manit Chanthavong
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top