Go Back   Trackpads Community > General Discussions > Computer and Technology > Web Design

Web Design Forums and discussions on webdesign

Web Design

Reply
 
LinkBack Thread Tools
Old 07-08-2004, 07:31   #1 (permalink)
Astra
Civilians

 
Default displaying the HTML code in HTML

Hi All

Bit of a dilemma here.

I'm doing a content management system, whereby the user can enter the HTML
code for a currency symbol, eg £ for £.

My problem is that when I bring this data backup, say they want to edit the
settings, then my ASP/HTML page is rendering the HTML code, eg £, rather
than showing the original value, eg £.

If for example I put a space between the '&' and the 'pound;', eg & pound;
then this will cause me problems because the user will think that they have
to a put a space in or they file it with the space, which means the HTML
code won't work any more.

Is there a way round this?

Rgds

Robbie


 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Trackpads Information
Click to Visit
Old 07-08-2004, 07:31   #2 (permalink)
Andrew Urquhart
Civilians

 
Default Re: displaying the HTML code in HTML

*Astra* wrote:
> Hi All
>
> Bit of a dilemma here.
>
> I'm doing a content management system, whereby the user can enter the
> HTML code for a currency symbol, eg £ for £.


IMO the user be able to enter the symbol directly as '£' and the CMS
then handles the conversion to an entity itself (where needed) without
user intervention. Mind you, it depends on the type of user that uses
your CMS, but for Joe Bloggs/John Doe I'd not want them to have to learn
something technical like entity encoding.

> My problem is that when I bring this data backup, say they want to
> edit the settings, then my ASP/HTML page is rendering the HTML code,
> eg £, rather than showing the original value, eg £.


Are you using Server.HTMLEncode on the way out? If you're not then you
potentially open yourself up to cross-site scripting issues.

> If for example I put a space between the '&' and the 'pound;', eg &
> pound; then this will cause me problems because the user will think
> that they have to a put a space in or they file it with the space,
> which means the HTML code won't work any more.


IMO you should definately _not_ go this route

> Is there a way round this?


I'd prefer to let the user enter text in the plain format they already
know and handle encoding and special character issues in the CMS behind
the scenes. If you don't want to do that then Server.HTMLEncode will
cure this issue (always use it when user data that is not meant to be
HTML is returned to a page!)
--
Andrew Urquhart
- My reply address is invalid, see www.andrewu.co.uk/contact/


 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-08-2004, 07:31   #3 (permalink)
Andrew Urquhart
Civilians

 
Default Re: displaying the HTML code in HTML

*Astra* wrote:
> Hi All
>
> Bit of a dilemma here.


Ah, you multi-posted this to
news:microsoft.public.inetserver.asp.general

"
What is multi-posting? Multi-posting is the posting of the same question
to more than one newsgroup but without cross-posting. Cross-posting is
an efficient way of sending messages to more than one group because only
one message actually exists despite it being seen in potentially many
other groups. Also when someone takes the effort to reply to that
question in one newsgroup, the other groups will also see the answer.
That way people know to stop replying to that question if it's been
answered, or may correct mistakes in someones reply. With multi-posting
people send the same message as individual messages to many groups. When
a person in one group replies to it the other identical messages aren't
updated with the reply. This leads to the situation where many people
take time out in different groups to answer the same question, despite
it being answered already. It's a waste of their time when they could be
helping someone else. Also it's a waste of resources since news servers
around the world have to store your 15 (say) identical messages, as
opposed to just one message when you use cross-posting.
"
--
Andrew Urquhart
- My reply address is invalid, see www.andrewu.co.uk/contact/


 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-08-2004, 07:31   #4 (permalink)
Astra
Civilians

 
Default Re: displaying the HTML code in HTML

Many thanks Andrew

Rgds

Robbie

"Andrew Urquhart" <useWebsiteInSignatureToReply@spam.invalid> wrote in
message news:r4SGc.287$tX3.195@newsfe6-gui.ntli.net...
*Astra* wrote:
> Hi All
>
> Bit of a dilemma here.


Ah, you multi-posted this to
news:microsoft.public.inetserver.asp.general

"
What is multi-posting? Multi-posting is the posting of the same question
to more than one newsgroup but without cross-posting. Cross-posting is
an efficient way of sending messages to more than one group because only
one message actually exists despite it being seen in potentially many
other groups. Also when someone takes the effort to reply to that
question in one newsgroup, the other groups will also see the answer.
That way people know to stop replying to that question if it's been
answered, or may correct mistakes in someones reply. With multi-posting
people send the same message as individual messages to many groups. When
a person in one group replies to it the other identical messages aren't
updated with the reply. This leads to the situation where many people
take time out in different groups to answer the same question, despite
it being answered already. It's a waste of their time when they could be
helping someone else. Also it's a waste of resources since news servers
around the world have to store your 15 (say) identical messages, as
opposed to just one message when you use cross-posting.
"
--
Andrew Urquhart
- My reply address is invalid, see www.andrewu.co.uk/contact/



 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML code...On or Off? DocDiggs Archived Help Requests 5 10-18-2005 18:19
Inserting HTML code in an HTML page Francesky Web Design 4 07-22-2005 04:00
Re: Displaying Microsoft Project Data in .html format Mike Glen Microsoft Applications 1 07-12-2005 16:00
Re: displaying html using javascript? Ian Web Design 6 04-21-2005 04:00
Display html example code within html GitarJake Web Design 1 11-05-2004 16:00


Community Information
Options
Quick Options
Trackpads Non-Commercial Ad
Copyright Information Click to Visit
Time
Server Time
All times are GMT -4. The time now is 08:37.
Copyright
Copyright Information
The header is based off of work by Vipixel.com and modified by this site. Trackpads and the Trackpads Logo are both Registered Trademarks of Jason Edwards and cannot be used without prior written permission.  The only exception is as a link back to this site. Trackpads is a private website run by a small legion of volunteers, 3 dogs, 12.5 cats and an army of small, super smart, bio-engineered mice with pointy hats and tutu's. Search Engine Friendly URLs by vBSEO 3.2.0 RC7
Archive Links
Archive Links
Page generated in 0.89268 seconds with 19 queries