Login Control!!

V

Vai2000

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
 
B

Bhaskardeep Khaund

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
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
 
V

Vai2000

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


Bhaskardeep Khaund said:
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
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 said:
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
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top