473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

URLEncode

djc
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.
Nov 19 '05 #1
4 2564
> 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**************@tk2msftngp13.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.

Nov 19 '05 #2
djc
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***@DIESPAMMERSDIEtakempis.com> wrote in message
news:OQ**************@TK2MSFTNGP10.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**************@tk2msftngp13.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.


Nov 19 '05 #3
See:

http://msdn.microsoft.com/library/de...codetopic1.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"djc" <no***@nowhere.com> wrote in message
news:e3**************@tk2msftngp13.phx.gbl...
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***@DIESPAMMERSDIEtakempis.com> wrote in message
news:OQ**************@TK2MSFTNGP10.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**************@tk2msftngp13.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.
>
>



Nov 19 '05 #4
djc
thanks, will do.

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:up**************@TK2MSFTNGP15.phx.gbl...
See:

http://msdn.microsoft.com/library/de...codetopic1.asp
--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

"djc" <no***@nowhere.com> wrote in message
news:e3**************@tk2msftngp13.phx.gbl...
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***@DIESPAMMERSDIEtakempis.com> wrote in message
news:OQ**************@TK2MSFTNGP10.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**************@tk2msftngp13.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.
>
>



Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Joshua Beall | last post by:
Hi All, I can see from the manual that the difference between urlencode and rawurlencode is that urlencode translates spaces to '+' characters, whereas rawurlencode translates it into it's hex...
3
by: JP SIngh | last post by:
Hi All I have users who upload files using my application using ASPUPLOAD component. My code uploads the file to a network location and once the upload is finish I display the hyperlink using...
1
by: yawnmoth | last post by:
Any ideas as to why urlencode(addslashes(chr(0))) returns '%5C0'? It seems like it should return '%00' since that's what urlencode(chr(0)) returns. If not that, I could also see it returning...
1
by: Jim | last post by:
Hello, I'm trying to do urllib.urlencode() with unicode correctly, and I wonder if some kind person could set me straight? My understanding is that I am supposed to be able to urlencode...
4
by: Andreas Klemt | last post by:
Hello, is there a difference between System.Web.HttpUtility.UrlEncode and Server.UrlEncode ?
1
by: Dario Sala | last post by:
Hi, what's the difference about Asp Server.UrlEncode and the Asp.Net Server.UrlEncode ? In asp: Server.UrlEncode("*") = %2A In Asp.Net: Server.UrlEncode("*") = *
0
by: Nathan Sokalski | last post by:
I am using Server.UrlEncode to make a piece of data safe to use as a QueryString. The data I am using is as follows: ratedpoem("title") Which returns the following String: "An Expression...
9
by: Mark_Rarefy | last post by:
Trying to urlencode this string: »ÁÏŒŠ˜ªŒ›h^aYh in vb.net (using either HttpUtility.UrlEncode(strEncrypted, encoding.UTF8) orServer.UrlEncode) I get:...
12
by: sleytr | last post by:
Hi, I'm trying to make a gui for a web service. Site using character in value of some fields. But I can't encode this character properly. >>> data = {'key':''} >>> urllib.urlencode(data)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.