Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

I am doing change password screen, this page will be redirected for two pages.

1.forgot password screen

2.if firsttime login then
it will be redirected from login page

my needs is

if the change password screen redirected from forgot password screen means, i have to hide the old password and its validation

if the change password screen redirected from login(force changepassword) screen means, i have to show the old password and its validation


give me any idea please

Thanks in advance
Posted

You can use QueryString to do this task.
Add a QueryString when you redirect the page.
Eg :
C#
//If redirecting from forgot password
 Response.Redirect("~/ChangePassword.aspx?rd=fp"); //better encrypt the querystring
//If redirecting from login password
 Response.Redirect("~/ChangePassword.aspx?rd=lg");

//And then on change password page Check the query string
If(Request.QueryString["rd"].ToString() == "fp")
{
 //redirected from forgot password
 //do your things
}
else
{
 //redirected from login password
 //do your things
}

You can do same things by setting a Session variable.

Good luck.
 
Share this answer
 
v4
Comments
avelsamy 30-Jul-14 1:15am    
dear rajesh, i hope it will work, one more think is, from forgot password screen i have fromed the query string (link ) then i sending mail to the respective user,

1 is redirecting
2 is link also...

okay i got some ideas from ur points... i will let u know about it

thank you
have you tried with Previous Page technique,
you can find out more Here[^]
 
Share this answer
 

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



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