C# - Login.aspx Page Should Redirect To A Different Page?

Mar 16, 2011

I am using Forms Authentication and have stored the credentials in the Web.config since there are only two credentials. Currently I have a login page that on authentication would redirect to the default.aspx page or the return url. I want to redirect to a different page i.e. form1.aspx or form2.aspx based upon the credentials.

Currently using

if (FormsAuthentication.Authenticate(txtUser.Text, txtPassword.Text))
{
FormsAuthentication.RedirectFromLoginPage(txtUser.Text, false);
}

View 2 Replies


Similar Messages:

Security :: Redirect To Main.aspx After Successful Login Attempt In Login.aspx Page

Apr 25, 2010

I'm trying to develop a simple web application where I need to redirect to main.aspx after successful login attempt in login.aspx page.However,it is redirecting the page to defualt.aspx... Is there a way to redirect my application to main.aspx??

View 3 Replies

Security :: Logout Redirect - Convert To Login.aspx Page?

Sep 22, 2010

When I click the "Log out", I would like to convert to login.aspx page.What do I do?

View 2 Replies

Web Forms :: How To Redirect To Login Page When Any Page Is Idle For 5 Minutes

Feb 23, 2010

I want to redirect to login page when any page is idle for 5 minutes and after re login I want to redirect to the page user is earlier in .

View 2 Replies

How To Redirect User From Login Page To Next Page Base On Their Role In C#

Jul 26, 2010

I am using built-in asp.net Role and membership provider in my website. when user login to my system they are redirected to hompage. how should i code it. that when he click on login button page check its role and then decide where to redirect. Suppose user login with name John and "john" is "Admin" then application Redirect him to AdminPanel.aspx and if User john is normal "RegUser" Role then redirect him into Home.aspx.

View 1 Replies

State Management :: Redirect Page To Login Page On Logout?

Dec 2, 2010

In logout link's click event i have written Session.Abandon() that will destroy the Session state.I am also handling Session_End event that is fired afterward (written in Global.asax). But one more thing i want is that after Session ends, login page should be redirected (opened).

For that i wrote:

[Code]....


This is working fine on the surface, but after applying debugging i saw that there were unexpected number of calls to Session_Start and Session_End events for two times, then login page was opened.

Why Session_Start and Session_End was called two times ? If i left this process as it is working then may i get some serious error in future ?

View 4 Replies

Web Forms :: Redirect To Requested Page Instead Of Default Page After Login?

Jul 17, 2015

I have created an order checkout page.when i click checkout button then it check user login or not if not then it redirect to login page .after login i want to show

my previous link page

View 1 Replies

HTTPS ASPX Page Redirect To HTML Page Logs User Out - As If Session Lost?

Sep 10, 2010

Building asp.C# shopping app that is using a hosted payment page to process payments (using posting of data to a hosted payment page). SSL certificate is signed and installed.

Flow:

Prelim) (HTTPS) Users authenticate using asp Login control

1) Users add items to cart.

2) (HTTPS)Users go to checkout page.

3) Users finalize their order, then click pay now after agreeing to T&C.

4) Server gets cart data (from MSSQL2005) and sets a transaction cookie (expiry set to 20 mins).

5) (HTTPS) Server Response.Redirects to an html page (in the same folder as the login protected pages).

6) Html page reads transaction cookie data and generates form fields.

7) (HTTPS) Html page posts data to hosted payment page (php).

8) User enters payment info and clicks pay now.

9) (HTTPS) hosted payment page posts info back to a .aspx page that checks if payment OK.

10a) If payment !OK, redirects to a declined page.

10b) (HTTPS) If payment OK, sets a verification cookie (expiry set to 20 mins). Then redirects to another html page.

11) Html page reads cookie data and generates form fields.

12) (HTTPS) Html page posts data to hosted verification page (php).

13) Verification page verifies (of course), if transaction ok.

14) (HTTPS) verification page posts data to a .aspx page that checks if verification OK.

15) If verification OK, process orders and do receipt stuff.

Issue:

This control flow was tested on an unsigned dev environment. SSL was being enforced, if needed on the unsigned SSL certificate. So we'd get prompts that certificate may be bad, but the control flow worked seamlessly.

However, now live with a signed SSL certificate, going from step 5 to 6, we are encountering a situation where some users (not duplicated every time, but verified that it does occur) when they click pay now and are redirected to the html page, they are forced back to the ~/login.aspx page (as if they were logged out).

Things to note:

a) The session did not time out.

b) The browsers have cookies and javascript enabled.

c) I can process the entire flow seamlessly on the same machine with other accounts, and occasionally, the same account.

So, basically, I'm stumped... Is this a viewstate error? A login control bug that won't let me redirect to an html page because it is now using a real SSL? Anyone have any experience with this kind of deal? I'm at a loss for solutions at this point.

View 1 Replies

How To Redirect A User To A Member Only Web Page After The Login Page

Mar 28, 2010

I am trying to redirect a user to a member only web page after the login page.
I have the following web forms.
LoginForm.aspx
PublicForm.aspx (anyone can see)
SecureForm.aspx (members only)
In the Web.config, I included

Code:

<authentication mode="Forms">
<forms name="Login"
loginUrl="LoginForm.aspx"
protection="All"
slidingExpiration="true"
path="/">
</forms>
</authentication>
<authorization>
<deny users="*"/>
</authorization>
<location path="PublicForm.aspx">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>
<location path="SecureForm.aspx">
<system.web>
<authorization>
<deny users="guest"/>
<allow users="member"/>
</authorization>
</system.web>
</location>
</authorization>
For the Login button in the LoginForm.aspx, I used this

Code:

FormsAuthentication.RedirectFromLoginPage(txtID.Text.Trim, False)
This code directs me to the Default.aspx which has nothing in it.
I will have a 404 if I take out the Default.aspx.

View 11 Replies

MVC :: How To Redirect To Login Page When Access A Page After Logout

Nov 19, 2010

usually in asp.net mvc there is thing [authorize]...which will allow users only after authetication...but this works on in bulit logins in asp..

now am creating my own login...with user name and password...afteri logout...when user tries to access the home of my it should redirect to login page...and the cache should be cleared

View 3 Replies

AJAX :: Redirect To Login Modal Popup Instead Of Login Page In Forms Authentication

Dec 1, 2010

I have my website in which there are free links and links that require login. Free links open even if the user is not logged in. But in case of links that require login, redirect to login.aspx specified in Web.Config in loginURL tag.

I want some way to override this and show Ajax modal popup (Ajax extender toolkit) with login control for only thos links that require login (not for the free links).

View 5 Replies

Security :: Catch A Failed Login Attempt (Windows Auth) And Redirect To A Forms Login Page?

May 26, 2010

I need to create an application with Forms Authentication and/or Windows Authentication. If the application is set to use mixed authentication (Forms + Windows Auth) and the user don't have a Windows user account, the login will fail and he must be redirected to a forms login page. How can I do this?

Are there any different way to provide mixed authentication?

View 1 Replies

On Login Error, Redirect To Separate Login Page?

Aug 25, 2010

I have a home page that is very design-specific, down to the pixel. It needs to have username/password/login, but I can't have it showing any error messages there. There is a separate standalone login page that is not design-specific and can show any messages. It's using the standard Login control.Is there an easy way to link the two so that if an error occurs on the home page the standalone page comes up with the errors?

View 2 Replies

Redirect Aspx Page To Xaml Page

Mar 19, 2011

I have a startup page as Menu.aspx I want to redirect this page to login.xaml so that whenver user type Menu.aspx it should open login.xaml then this .aspx page.

View 1 Replies

Security :: Make Login.aspx Called By A Form At Page Load And Return To It After Successful Login

Apr 12, 2010

A Login.aspx has been created to enforce security on several forms of a web site.How can it be best called by each form at page load and return to that form after succesful login? How could that requirement be declared in web.config?

View 3 Replies

Security :: Cannot Redirect To Login.aspx - How To Redirect To It

Apr 16, 2010

my application is running under asp.net 2.0 and in iis 5.0 (Windows XP) in my machine.config, i have the following setting

[code]...

whenever i go to my default.aspx page, it seems it doesn't redirect to login.aspx.

View 5 Replies

State Management :: Page To Automatically Redirect To A "registrationClosed.aspx" Page On A Specific Date?

Jan 24, 2011

I have a page that allows visitors to register for an account, but I want this page to automatically redirect to a "registrationClosed.aspx" page on a specific date...

View 10 Replies

User Controls :: How To Redirect To Login Page If User Directly Visits Page In MVC

Jun 11, 2013

i am developing one application in mvc my problem is after login it will redirect to some page if i copy url and paste it in another browser its showing error in application but i need to display home page? 

how to solve this ?

View 1 Replies

Can Redirect To Login Page Which Is In Another Site?

Mar 31, 2010

I have two sites that are app1 and app2. If a user requests a resource in app2, in order to authenticate, I like to redirect to the login page which is in app1. Once authenticated over there, return back to app2.

View 1 Replies

Redirect To Https Login Page

Jun 9, 2010

I have a site that has a mix of http and https pages. Under the root of the site, one folder has all the http pages and another has all the https pages. Login is over https and sends the user to the other pages. When a session expires the forms authentication redirects to the Login page but the browser uses http and the user gets a 403 error. Is there any way to override the session timeout to send it to https?

View 1 Replies

User Controls :: Validate Session Set After Login And Redirect User Back To Login Page If It Is NULL

Apr 26, 2013

I have made a web page in which there is login screen when user login it goes next page but my problem is if i directly enter the url of that page it open. I want it should not open unless the user log in... 

View 1 Replies

Web Forms :: How To Login And Redirect To Same Page And Use The Session

Jun 18, 2010

I have 1 master page and Home.aspx page. Home.aspx page is using the master page.. In master page i have two textbox and and menu control and button. Textbox are used for login and password. by default Home.aspx opens.....Now when user login then i check the user exist of not in my master page codebehind and then redirect to Home.aspx but this time i want the textbox and button not to be visible. In master page i used session to store the login is true or not and the usertype and then redirect to Home.aspx. but i am not able to use the session.

View 15 Replies

Security :: Redirect To Login Page After Logout

Mar 6, 2010

I am Creating a Webapplication. In that i kept Login options where users can login. Some users access the data without login. I want when user want to access without login it should redirect to login page.

View 5 Replies

How To Redirect Unauthorized User To A Login Page

Mar 19, 2010

I have myown login page.If any user access any page directly(without login),i want to redirect unauthorized user to login page....How it possible.....Using Generic Handler is there any chance? or how can i do it ?

View 2 Replies

Security :: Page Redirect When User Login?

Mar 24, 2010

I got a role call "Staff", staff registration is done by admin so when creating a new staff only need their name, user name, password and e-mail. After registering, i wan to redirect the staff to the creating profile page to input their contact number and self-description which is a must for later use. For first time login staff, how do i compare and see if the contact and description profile is empty or not? If it is empty, then redirect to the create profile page, else just go to staff page.

I trying to do like making each different role redirect to their own page once they had login. For now when the user login they will remain in the same page showing the login template. How do i do that?

[code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved