Is it possible to redirect to another page in your application from the start page BEFORE the user has been authenticated if you're using FORMS authentication? I can't seem to get it to work.
Simple example: In your start page simply try to redirect...
private void Page_Load(objec t sender, System.EventArg s e)
{
if (!IsPostBack) // or is. doesn't matter.
{
Response.Redire ct(APageInYourA pplication.aspx );
}
}
I also tried
Response.Redire ct(APageInYourA pplication.aspx ,false);
and
Server.Execute( APageInYourAppl ication.aspx);
all to no avail.
The reason I'm doing this.........
The application can be configured to run either 'browser' mode or "applicatio n" mode. (both load in the browser, just in application mode I remove all the browser controls.)
Now, you can't initiate the application without all the controls. You have to load a page first then do a window.open and specify the window parameters. So... I load a small window, window.open() to the login page then try to close the small window. Closing the small window requires the user to confirm. Can't get around that. Anyway... since the small window just does a window.open() then immediately tries to close itself, it never fully renders before asking to user to allow it to close. Therefore my "loading... " graphic never displays and the user is left staring at a blank page. So I figured, load the graphic, redirect to another page that will do the window.open() so that the first page can finish rendering and display my graphic and then close the window.
But it seems you cannot redirect from the start page if you're using Forms authentication.
Any ideas? Am I WAAYYY off?
1 2601
Is it possible to redirect to another page in your application from the start page BEFORE the user has been authenticated if you're using FORMS authentication? I can't seem to get it to work.
Simple example: In your start page simply try to redirect...
private void Page_Load(objec t sender, System.EventArg s e)
{
if (!IsPostBack) // or is. doesn't matter.
{
Response.Redire ct(APageInYourA pplication.aspx );
}
}
I also tried
Response.Redire ct(APageInYourA pplication.aspx ,false);
and
Server.Execute( APageInYourAppl ication.aspx);
all to no avail.
The reason I'm doing this.........
The application can be configured to run either 'browser' mode or "applicatio n" mode. (both load in the browser, just in application mode I remove all the browser controls.)
Now, you can't initiate the application without all the controls. You have to load a page first then do a window.open and specify the window parameters. So... I load a small window, window.open() to the login page then try to close the small window. Closing the small window requires the user to confirm. Can't get around that. Anyway... since the small window just does a window.open() then immediately tries to close itself, it never fully renders before asking to user to allow it to close. Therefore my "loading... " graphic never displays and the user is left staring at a blank page. So I figured, load the graphic, redirect to another page that will do the window.open() so that the first page can finish rendering and display my graphic and then close the window.
But it seems you cannot redirect from the start page if you're using Forms authentication.
Any ideas? Am I WAAYYY off?
If you move the window.close() into an increment or timer sequence (client side) in the popup, that should allow your popup to load before closing. The ideal place for it would be at the tail end of the process you're showing in the popup, if that is on the browser. Also the user should not have to confirm the close, that should only be for the main open page, not the popup. What is your 'dependent' set to for the popup?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: PaulThomas |
last post by:
Working with XP-Pro and VS.Net I have set my Start Page to "Home.aspx" but
the application always starts the "Login" page - - - How can I change the
start page to the Home.aspx???
On the login page that displays I have
private void LinkButton1_Click(object sender, System.EventArgs e)
{
bool MyVar = true;
Msg.Text = "ReDirecting to Home.aspx";
Response.Redirect("Home.aspx",MyVar);
}
|
by: Donald Williamson |
last post by:
Hi
Hope someone can help me with authentication and how the redirects work. I'
ve already tried searching previous posts but didn't really find anything.
for I have a page that checks to see if the user has logged in. If not, it
redirects them to the login page for authentication. After authenticating, I
want to redirect them back to the original page that sent them. I always get
redirected back to the default page. I noticed that...
|
by: Dave |
last post by:
Hi,
Is there anyway to mimic forms authentication's loginUrl
and RedirectFromLoginPage functionality using Windows
authentication?
We are developing intranet sites using basic
authentication and we want to always redirect a user to a
default 'splash' or welcome page that is set to anonymous
if they are not logged in. This page would have
|
by: Ed Henn |
last post by:
I'm having a problem with .NET Forms Authentication in a particular
application. It's not redirecting properly when my session is timed
out, seemingly only when I POST the page (i.e. click a form submit
button). If I try to GET a page after timeout (i.e. just picking a page
to visit from a menu), I am redirected to the login screen properly.
The browser error I'm getting in the POST example is "403.1 Execute
Access Forbidden". I...
|
by: Peter Row |
last post by:
Hi,
I better get the background stuff out the way first, so here goes:
- Porting a VB6 webclass app to VB.NET using HttpHandlers and
FormsAuthentication
- When someone visits my site unbeknown to them they are automatically
logged in as a guest
via the .NET forms authentication.
| |
by: Grey |
last post by:
I have set the following parameters in web.config to prevent user direct
access the web page without user login.
<authentication mode="Forms">
<forms loginUrl="Initial/index.aspx" name="adAuthCookie"
timeout="60" path="/" >
</forms>
</authentication>
The application did success to redirect to login page, but it cannot
redirect back to desire page which I specify in URL. What's wrong with my
|
by: Sospeter |
last post by:
Hi Ken,
I have done that but still experiencing same problem. Tried the
following i.e. turning smartnavigation = false and using
server.transfer as below but nothing works.
Please help.
Page.SmartNavigation = False
FormsAuthentication.SetAuthCookie(txtCustID.Text, False)
|
by: Dr. Paul Caesar - CoullByte (UK) Limited |
last post by:
Hi,
I have created a Logout ASP.NET application using Forms Authentication.
When a user logs out they get a confirmation page confirming logout and a
button to click to return to the homepage.
We have the page designed so that if the user is not authenticated then they
get redirected using Response Redirect method to the homapage.
|
by: Tigertoes |
last post by:
I have been using forms authentication with no problems.
However, I now want to navigate around various forms on my site using FULL URLs (i.e http://host/xxx/yyy.aspx etc). When I hit the redirect code, it obviously tries to redirect to the required form, BUT, forms authentication kicks in again and we're redirected to the Login page.
e.g.
This line works:
response.redirect("DetailForm.aspx") and we're redirected to the detail form
This...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |