Add a META line to an existing HTML doc programmatically

B

Bill Nguyen

The HTML doc looks like this:

<HTML xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:blush:="urn:schemas-microsoft-com:blush:ffice:blush:ffice">

<HEAD>
<META NAME="Generator" CONTENT="Microsoft MapPoint 2004">



Now I need to add a META line to force the browser to refresh every 5
minutes as follow:

<HEAD>
<META Http-Equiv="Refresh" CONTENT="300" />
<META NAME="Generator" CONTENT="Microsoft MapPoint 2004">


Any suggestion is greatly appreciated!


Thanks



Bill
 
R

Rad [Visual C# MVP]

Hey Bill,

there is a HtmlMeta class that you can use to do just that! You put
the code in the Page_Load class and it will populate the tags for you

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)

' Create two instances of an HtmlMeta control.
Dim meta As New HtmlMeta()

' Get a reference to the page header element.
Dim head As HtmlHead = Page.Header

' Define an HTML <meta> element
hm1.Name = "keywords"
hm1.Content = "one, two, three"
head.Controls.Add(hm1)

End Sub
 
B

Bill Nguyen

Dear Rad;
I'm new to this.
Can you please elaborate a bit further?

Assuming I have an existing HTML file in C:\temp\My.HTML

How do I open it for editingt in VB.NET?

Thanks again

Bill
 

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

Top