i have write a code for recovery password...so now when the user forgot thier Id or Password it can be recovered by entering
thier email address, the system will check the email either the email valid or not in database, if valid it will return the Id and Password by using
ClientScript.RegisterStartupScript,....need help how to do that....i i provide my code to ensure expertise here have a clear picture what i'm talking about, please see my code below:
cmdUser.CommandText ="select UserName from MaklumatGuru where email=@email"
I think if you forget the password, you can try to do the following steps:
1) Your User table should include several things:
UserName, Password, ForgetTips (Your UserName is unique).
2) If someone forgets password, he/she should fill in the UserName and well as ForgetTips, and then we can check by the two things to see whether we can find the result or not, if yes, we can return the password to the user.
afastars
Member
52 Points
221 Posts
display ClientScript message base on sql data
Nov 03, 2012 07:46 AM|LINK
i have write a code for recovery password...so now when the user forgot thier Id or Password it can be recovered by entering
thier email address, the system will check the email either the email valid or not in database, if valid it will return the Id and Password by using
ClientScript.RegisterStartupScript,....need help how to do that....i i provide my code to ensure expertise here have a clear picture what i'm talking about, please see my code below:
cmdUser.CommandText ="select UserName from MaklumatGuru where email=@email"
cmdUser.Parameters.AddWithValue("email", txtemail.Text)
Dim recovertUserName As String = cmdUser.ExecuteScalar()
cmdPass.CommandText ="select Password from MaklumatGuru where email=@email"
cmdPass.Parameters.AddWithValue("email", txtemail.Text)
Dim recoverPassword As String = cmdPass.ExecuteScalar()
heyitsme
Participant
1386 Points
502 Posts
Re: display ClientScript message base on sql data
Nov 03, 2012 09:56 AM|LINK
whats your exact requirement? Do you want to pop up the password when the user enters his email id?
afastars
Member
52 Points
221 Posts
Re: display ClientScript message base on sql data
Nov 03, 2012 10:06 AM|LINK
hi heyitsme
thanks for reply
yes correct i want to pop up the UserId and the Password after he/she enter the correct email address that belong to them
need help
heyitsme
Participant
1386 Points
502 Posts
Re: display ClientScript message base on sql data
Nov 03, 2012 10:36 AM|LINK
then you can fetch password from database based on email id and display as an alert
dim strPassword as string="password" //fetch password from database
ScriptManager.RegisterStartupScript(updPnl, updPnl.GetType(), "Msg", "alert('" & strPassword & "')", True)
where updPnl is the ID of the update panel
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: display ClientScript message base on sql data
Nov 04, 2012 12:46 AM|LINK
Hello,
I think if you forget the password, you can try to do the following steps:
1) Your User table should include several things:
UserName, Password, ForgetTips (Your UserName is unique).
2) If someone forgets password, he/she should fill in the UserName and well as ForgetTips, and then we can check by the two things to see whether we can find the result or not, if yes, we can return the password to the user.
afastars
Member
52 Points
221 Posts
Re: display ClientScript message base on sql data
Nov 04, 2012 01:45 AM|LINK
hi heyitsme
thanks for reply
i got it work, it work fine thanks your very much
....but how to write the code to display forgot userID and
password in same message box
please see my code below:
ScriptManager.RegisterStartupScript(updPnl, updPnl.GetType(),"Msg", "alert('Id Pengguna :" & recovertUserName & "', 'Password :" & recoverPassword & "')", True)
these code above only display the UserId only, and not display the password,
why we need to use update panel..? if i don't want to use update panel how the code should look like..?
i'm new in programming asp.net and need a lot's of information
, i
also new in this concept, hope you don't mine to explain it a bit
afastars
Member
52 Points
221 Posts
Re: display ClientScript message base on sql data
Nov 04, 2012 01:46 AM|LINK
hi Decker
thanks for reply
yes i already done it....
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: display ClientScript message base on sql data
Nov 04, 2012 02:21 AM|LINK
And what's up now?It should work well……Any exceptions?
afastars
Member
52 Points
221 Posts
Re: display ClientScript message base on sql data
Nov 04, 2012 02:42 AM|LINK
please see this thread Try Catch In FormView, i already reply on this thread, and have a question on that
need you help
heyitsme
Participant
1386 Points
502 Posts
Re: display ClientScript message base on sql data
Nov 05, 2012 06:21 AM|LINK
if your page contains an update panel, u should use scriptmanager.registerstartup for displaying alert msg
and if you dont have an update panel you can use