Pop up window

G

Guest

Hi Guys, I have a column in table changepassword in users table. Possible
values Y and N.
I want the user to login at the login.aspx page and when redirected(based on
successfull login) to default.aspx page, they should recieve a pop up window
to change password if the value is set to Y in database.

Can this be done? if yes can someone provide code to achieve this.

Thanks

Manny
 
K

Karl Seguin

sure, in Login.aspx's PagE_Load event you could do something like:

if CurrentUser.MustChangePassword then
Page.RegisterStartupScript("ScrollToBottom", "<script
language='javascript'>" + System.Environment.NewLine +
"window.open('changePassword.aspx', '', '');" + System.Environment.NewLine +
"</script>")
end if

or something similar

the trick is how to force the user to change his password? He/she could
simply close the popup. Some solutions that come to mind are (a) pop it up
on each and every page ..eventually they'll get sick and tired (b) use a
modaless dialog


To be honest, my preferred approach would probably be, instead of
redirecting to default.aspx, when the user logged into login.aspx, why not
check if changepassword is 'y' and redirect to "changepassword.aspx" which
would then go to "default.aspx", instead of going directly to
"default.aspx"?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top