thanks for the reply Spencer...
1) My data is stored in 'normal' text in the database. So I can run this
text through HtmlEncode before displaying it on the web page and the line
breaks and spacing would be preserved (in html format)?
2) If I wanted to allow a user, on the data input side of things, to be able
to use html tags would HtmlEncode be used for that also? would the data then
be stored in the database encoded rather than 'normal' text? (bad if a
different non-browser front end were to need to display the data)
Scenario 1: what if I need the data to be stored in the database in
'normal' text but displayed literally when output to screen via browser
(meaning show the html tags... like for showing code examples)?
Scenario 2: what if I need the data to be stored in the database in
'normal' text but when output to the browser have the browser actually
interpret the html tags?
any more info is greatly appreciated. Thanks again.
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:OQ******** ******@TK2MSFTN GP10.phx.gbl...
I have since come accross this URLEncode method. Is this something that
I should have used for this instead?
No. URLEncode is for URLs. HtmlEncode encodes strings to HTML-Friendly
format.
--
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"djc" <no***@nowhere. com> wrote in message
news:uA******** ******@tk2msftn gp13.phx.gbl... 1) I just recently used my own function which simply replaces cariage
return
/ line feed characters with <br> tags for a large detail field before
showing it via an asp.net page to preserve line breaks for web display.
I have since come accross this URLEncode method. Is this something that
I should have used for this instead?
2) currently if you were to enter html tags into an input field on my
asp.net web page the app will crash... I know this is by design for
security
reasons and if I don't require html tags being input I should just trap
this
error and handle it.
What if I wanted to allow the html tags to be input? (URLEncode?).
any info would be appreciated. Thanks.