Thursday, March 29, 2012

Login Control!

Hi All, I have a website which allows users to visit anonymously. Throughout
the page I offer a signup link thru which a user can create an account. I
want the user to be redirected to the page on which he working when he
clicked up the signup link (which is create account wizard page )
How to accomplish this?

I know the request.REferealURl etc...API's but don't know where in the
create account wizard I shud place this?

TIAHi,

when someone tries to access your secured page, the most probale way you
would be using is on Page_Load you would check if his session value is not
null, in case it is you will redirect him to the login page with appropiate
message. What you can do here is, you can pass the url of the page he has
got redirected from to the login as querystring, and after proper validation
you can redirect him back to that page as you would have the URL,...e.g:-

in your page_load, you would write..........

if (Session["LoginStatus"] == null){
Response.Redirect("UserLogIn.aspx?rurl=" +
Server.HtmlEncode(Page.AppRelativeVirtualPath));
}

and in your login page, after validation.....

if (username and password id valid logic) {
Response.Redirect(Request.QueryString["rurl"].toString());
}

Hope this helps.

Rgds,
Bhaskar

"Vai2000" <nospam@.microsoft.comwrote in message
news:OH%23XRCfSHHA.3500@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Hi All, I have a website which allows users to visit anonymously.
Throughout
the page I offer a signup link thru which a user can create an account. I
want the user to be redirected to the page on which he working when he
clicked up the signup link (which is create account wizard page )
How to accomplish this?
>
I know the request.REferealURl etc...API's but don't know where in the
create account wizard I shud place this?
>
TIA
>
>


Thanks, though was looking for some out of the box functionality in asp.net
2.0

"Bhaskardeep Khaund" <bhaskardeep@.rediffmail.comwrote in message
news:uYH9lifSHHA.5016@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Hi,
>
when someone tries to access your secured page, the most probale way you
would be using is on Page_Load you would check if his session value is not
null, in case it is you will redirect him to the login page with


appropiate

Quote:

Originally Posted by

message. What you can do here is, you can pass the url of the page he has
got redirected from to the login as querystring, and after proper


validation

Quote:

Originally Posted by

you can redirect him back to that page as you would have the URL,...e.g:-
>
in your page_load, you would write..........
>
if (Session["LoginStatus"] == null){
Response.Redirect("UserLogIn.aspx?rurl=" +
Server.HtmlEncode(Page.AppRelativeVirtualPath));
}
>
>
and in your login page, after validation.....
>
if (username and password id valid logic) {
Response.Redirect(Request.QueryString["rurl"].toString());
}
>
Hope this helps.
>
Rgds,
Bhaskar
>
>
>
>
"Vai2000" <nospam@.microsoft.comwrote in message
news:OH%23XRCfSHHA.3500@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Hi All, I have a website which allows users to visit anonymously.
Throughout
the page I offer a signup link thru which a user can create an account.


I

Quote:

Originally Posted by

Quote:

Originally Posted by

want the user to be redirected to the page on which he working when he
clicked up the signup link (which is create account wizard page )
How to accomplish this?

I know the request.REferealURl etc...API's but don't know where in the
create account wizard I shud place this?

TIA


>
>

0 comments:

Post a Comment