Refernecing Text of <p> tags

G

Guest

If I have some text which is between <p> tags, is there a way for me to
change the text which is in between the tags? I know that I could convert it
to a Label control and reference it that way, but I was wondering if there
was another way to do this.

<p id="Fred" style="Visibility: hidden">This is my Text</p>

Fred.?

Thanks
 
C

Craig

Hi Fred.

Here's a quick n dirty vb example.

<your aspx html>
<p runat="server" id="myptag"></p>
</your aspx html>

<your code behind file>
Protected WithEvents myptag As
System.Web.UI.HtmlControls.HtmlGenericControl

myptag.InnerText = "Some text here"
</your code behind file>

HTH
Craig
 

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

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top