Home All Groups Group Topic Archive Search About

Add a META line to an existing HTML doc programmatically

Author
29 Nov 2006 6:24 PM
Bill Nguyen
The HTML doc  looks like this:

<HTML xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office">

<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

Author
29 Nov 2006 8:19 PM
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



On Wed, 29 Nov 2006 10:24:58 -0800, "Bill Nguyen"
<billn_nospam_please@jaco.com> wrote:

Show quoteHide quote
>The HTML doc  looks like this:
>
><HTML xmlns:v="urn:schemas-microsoft-com:vml"
>xmlns:o="urn:schemas-microsoft-com:office:office">
>
><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
>
--

Bits.Bytes.
http://bytes.thinkersroom.com
Author
29 Nov 2006 11:00 PM
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

Show quoteHide quote
"Rad [Visual C# MVP]" <nospam@nospam.com> wrote in message
news:oiqrm2tnd9l0emprv934veoh7vbk85462i@4ax.com...
> 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
>
>
>
> On Wed, 29 Nov 2006 10:24:58 -0800, "Bill Nguyen"
> <billn_nospam_please@jaco.com> wrote:
>
>>The HTML doc  looks like this:
>>
>><HTML xmlns:v="urn:schemas-microsoft-com:vml"
>>xmlns:o="urn:schemas-microsoft-com:office:office">
>>
>><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
>>
> --
>
> Bits.Bytes.
> http://bytes.thinkersroom.com