Click here to Skip to main content
15,896,489 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

I am sending "Password" from one page to Other Page in a "Querystring" and setting it to the "textbox.Text" .Problem is page is showing empty textbox i.e. no password is there ,although I set the password.TextMode of textbox ie "Password".

Please friends help me.

Thanks in advance.
Posted
Comments
DominicZA 21-Jun-12 9:55am    
Send us your code. We cant have any idea what the problem is without code!
Sandeep Mewara 21-Jun-12 10:06am    
Password in querystring? Anyone asked you to do it this way?

1 solution

Best guess solution, try this:

C#
protected void Page_Load(object sender, EventArgs e)
{
      if (!String.IsNullOrEmpty(Request.QueryString["password"])
          txtPassword.Text = Request.QueryString["password"];
}


That will work assuming your URL looks something like this:

http://www.mysite.com/MyPage.aspx?password=bob

Just a thought, passing though a password in a query string makes is visible for the whole world to see. It might be a better idea to store it in the session. Have a read here: http://msdn.microsoft.com/en-us/library/ms178581.aspx[^]
 
Share this answer
 
Comments
Manas Bhardwaj 21-Jun-12 10:01am    
+5 for the recommendation to not use this approach :)
rahulbhadouria 21-Jun-12 10:08am    
I am passing password in Encrypted form.
so my URL looks like....http://www.mysite.com/MyPage.aspx?gjkaksh76572hgk.

And Decrypt on other page.I have successfully decrypted the password,But on UI it is showing the password textbox blank.

Is there any other way to set the TextBox text.when the TextMode is "Password".

i am bugged off by this problem.
Please help me out
DominicZA 21-Jun-12 10:15am    
How are you accessing the query string...it should look like this http://www.mysite.com/MyPage.aspx?password=gjkaksh76572hgk ... That way you can use my solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900