Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to use urlencode in asp and asp.net

Posted on 2009-12-25
7
Medium Priority
?
474 Views
Last Modified: 2012-08-14
In my asp.net registration page, I use Server.UrlEncode(TextEmail.Text) to store the email address.  In the 'forgot my password', which is written in asp, i use Server.UrlEncode(TextEmail.Text) to retrieve the email address.  But they don't match.  

The first page stores bbb%40b.com  when the user registers  (asp.net)

The asp page requests the account for the email address 'bbb%40bbb%2Ecom   (asp)

Same exact email address entered  (bbb@bbb.com)

How can i resolve this?
0
Comment
Question by:d2fox
  • 3
  • 3
7 Comments
 
LVL 61

Expert Comment

by:HainKurt
ID: 26123618
use
Server.UrlDecode(TextEmail.Text)
0
 
LVL 61

Expert Comment

by:HainKurt
ID: 26123621
0
 

Author Comment

by:d2fox
ID: 26123650
Sorry, I don't want to DECODE.  I have encoded it when i stored it (from asp.net), and it's stored as  bbb%40b.com  in the database as a result of my encoding.  Then another page (classic asp) wants to find this record.  So it URLENCODES again, and it requests the SQL record containing bbb%40bbb%2Ecom.  

My issue is that in the first case, the PERIOD is not encoded.  In the second it is.  SO the record is not found based on email address.  This is a problem.  I want them to match.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 9

Expert Comment

by:magicdlf
ID: 26123651
HainKurt is right. UrlDecode before your compare the email addresses.
0
 
LVL 61

Accepted Solution

by:
HainKurt earned 2000 total points
ID: 26123655
dont put anything in db as encoded...
decode and store actual values in db...
0
 
LVL 9

Expert Comment

by:magicdlf
ID: 26123662
You can decode it first, and store MD5 into your DB
0
 
LVL 9

Expert Comment

by:magicdlf
ID: 26123669
It looks like you only want to fix the dot '.' issue. You can just replace the strings either in the ASP side or ASP.NET side.
            string str = Server.UrlEncode("bbb@bbb.com");
            str=str.Replace(".","%2E");
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question