regarding Server.UrlEncode

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

hi

asp.net 3.5

I'm wondering if it's enough to UrlEncode the id, like
BQHeE3o+mAmFMFGO2Jhm9A==
or should I UrlEncode the entire URL, like
Default.aspx?k=BQHeE3o+mAmFMFGO2Jhm9A==

only the BQHeE3o+mAmFMFGO2Jhm9A== will have special chars...

any suggestions?
 
okay, I only UrlEncode BQHeE3o+mAmFMFGO2Jhm9A==

UrlEncode is used to encode value of the variables in URL strings, so
you have to encode the entire value.
 
Jeff said:
hi

asp.net 3.5

I'm wondering if it's enough to UrlEncode the id, like
BQHeE3o+mAmFMFGO2Jhm9A==
or should I UrlEncode the entire URL, like
Default.aspx?k=BQHeE3o+mAmFMFGO2Jhm9A==

only the BQHeE3o+mAmFMFGO2Jhm9A== will have special chars...

any suggestions?

If you url encode the entire url, then it doesn't work any more. You
only url encode the value.

If you put an url in a query string in another url that is a different
thing, then the url is the value, and you have to url encode the whole
value.
 
Back
Top