Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old July 28th, 2004, 12:12 PM
Registered User
Join Date: May 2004
Location: Athens, , Greece.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamically change html code of a page

I want to change the html tag of a Label

<asp:Label id="lbl" style="Z-INDEX: 101; LEFT: 128px; POSITION: absolute; TOP: 40px" runat="server">Label</asp:Label>

<asp:Label id="lbl" style="Z-INDEX: 101; LEFT: 128px; POSITION: absolute; TOP: 40px" runat="server"><a name="anchor">Label</a></asp:Label>

by hitting a button.

Could someone tell me how could I implement that with c#?

  #2 (permalink)  
Old July 28th, 2004, 01:49 PM
Friend of Wrox
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts

You can't achieve that by decoding the HTML:

lbl.Text = Server.HtmlDecode("<a name="anchor">Label</a>")

If that doesn't work, I don't know what your other option to do since the label control is not a container control.

  #3 (permalink)  
Old July 29th, 2004, 01:38 AM
Friend of Wrox
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post

lbl.Text = Server.HtmlDecode("<a name=anchor>Label</a>")
it works fine.
Thanks to Brian.


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to dynamically change an HTML page kpnikhil PHP How-To 1 September 7th, 2007 03:53 AM
Code change; Page 1074; Ch21 Nick Y BOOK: Ivor Horton's Beginning Visual C++ 2005 0 August 3rd, 2006 09:18 AM
How to change the globalization dynamically? sfs00784 General .NET 1 July 16th, 2004 04:13 AM
Change a button's name dynamically pigtail Javascript 2 April 11th, 2004 06:02 PM
Dynamically change event handlers oranginalab Javascript How-To 2 July 31st, 2003 10:11 AM

All times are GMT -4. The time now is 06:34 AM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.