How can I insert HTML markup that is interperted as such?

W

_Who

In the .aspx I have

<p runat="server" id="qq" > </p>

and in the aspx.vb I have

Protected Sub qq_Init(ByVal sender As Object, ByVal e As System.EventArgs)
Handles qq.Init

strContents = "<h1>QQQQQQ</h1>"

qq.InnerText = strContents

End Sub

But this produces as text

<h1>QQQQQQ</h1>

The tags are treated as text.

How can I insert HTML markup that is interpreted as such?



Thanks
 
G

George

_Who said:
In the .aspx I have

<p runat="server" id="qq" > </p>

and in the aspx.vb I have

Protected Sub qq_Init(ByVal sender As Object, ByVal e As System.EventArgs)
Handles qq.Init

strContents = "<h1>QQQQQQ</h1>"

qq.InnerText = strContents

End Sub

But this produces as text

<h1>QQQQQQ</h1>

The tags are treated as text.

How can I insert HTML markup that is interpreted as such?



Thanks



I belive there is InnerHtml which will not HtmlEncode the string you put
in..

George.
 
W

_Who

I almost have it working!
In the .aspx I have

<p runat="server" id="qq" > </p>

and in the aspx.vb I have

Protected Sub qq_Init(ByVal sender As Object, ByVal e As System.EventArgs)
Handles qq.Init

Dim csmKey As String = "CopyHtml"

Dim csmType As Type = Me.GetType()

Dim csm As ClientScriptManager = Page.ClientScript

If (Not csm.IsStartupScriptRegistered(csmType, csmKey)) Then

Dim csmScript As New StringBuilder() 'The startup script literal to register

csmScript.Append("document.write('<h1>ssssss</h1>")

csmScript.Append("<p>eeee</p>")

csmScript.Append("');")


csm.RegisterStartupScript(csmType, csmKey, csmScript.ToString, True)

End If
This does produce the formated tex on the page

But at the bottom of the page. Not where the qq is.

How can I control where it goes?
 
W

_Who

George said:
I belive there is InnerHtml which will not HtmlEncode the string you put


That makes sense. I'll look for it.
Please see my other reply to this topic.
Thanks
 

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,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top