473,804 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

redirect to default

Hi,
in asp.net , I set the start page to "myStartingPage .html"
when user get authenticated and the cookie is created, the following
statement is supposed to redirect him to the original requested url:
....... ..... .... ...
Dim url As String = FormsAuthentica tion.GetRedirec tUrl(userID, true)
Response.Redire ct(url)

but url value is always = "default.as px" and there is no "default.as px" in
the whole application.

isn't "myStartingPage .html" supposed to be the requested url , or I'm wrong ?
and how can I set the value of the default page to point to
"myStartingPage .html" ?

<authenticati on mode="Forms">
<forms name="exitinter viewCookie" protection="All " timeout="60"
loginUrl="Login .aspx" />
</authentication>

thanks

Nov 18 '05 #1
2 3065
Hi,

I'm not sure why you are getting that result. When I do this I've always
done it with one line:

FormsAuthentica tion.RedirectFr omLoginPage(use rID, True)

After you authenticate the user the line above will automatically move them
along. This way you don't need to use two lines of code or do the redirect
yourself. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight

"zino" <zi**@newsgroup s.nospam> wrote in message
news:0A******** *************** ***********@mic rosoft.com...
Hi,
in asp.net , I set the start page to "myStartingPage .html"
when user get authenticated and the cookie is created, the following
statement is supposed to redirect him to the original requested url:
...... ..... .... ...
Dim url As String = FormsAuthentica tion.GetRedirec tUrl(userID, true)
Response.Redire ct(url)

but url value is always = "default.as px" and there is no "default.as px" in the whole application.

isn't "myStartingPage .html" supposed to be the requested url , or I'm wrong ? and how can I set the value of the default page to point to
"myStartingPage .html" ?

<authenticati on mode="Forms">
<forms name="exitinter viewCookie" protection="All " timeout="60"
loginUrl="Login .aspx" />
</authentication>

thanks

Nov 18 '05 #2
Hi Zino,

As for the problem you mentioned, I think the main cause is the IIS Virtual
dir's default docment setting, also there are some other things we should
pay attention, let's check them step by step:

1. The reason why you found the FormsAuthentica tion.GetRedirec tUrl always
return the "default.as px" , I think this should occur when we visit the web
application via such url:
http://webserver/webapp/
rather than
http://webserver/webapp/certainpage.aspx yes? ( I think this url will be
redirected to login page with the
certainpage.asp x as the RedirectUrl value)

When we using the first style url, the IIS will look for the default
document in the VIRTUAL DIR, and by default there will have "default.as p",
"default.html", ... ."default.as px" in the default document list, and since
only the "default.as px" will be processed by asp.net , so the "Original
Requested Url" will be the "default.as px" when redirected to login page.

2. If you want to make your own page as the default visited document, you
can add them in the IIS's virutal dir default document list. Just start the
IIS management console( inetmgr.exe) and select the virtual dir's
properties and swtich into "documents" panel , you'll find that setting.

3. As you mentioned that you have your own start page "myStartPage.ht mL"
,yes? If so, I strongly recommend that you change your myStartPage.htm l
into an ASP.NET web page. Because only "aspx" page will be served by
asp.net runtime. Static pages othe static resource will directly be
processed by IIS rather than ASP.NET. So the html pages can't be protected
by the ASP.NET's formsauthentica tion. WE need to make all the pages( which
should be protected by forms authentication) as aspx page.

Please have a check on the above items. If you have any other questions,
please feel free to post here. thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3979
by: shank | last post by:
I have the following code to redirect users to http://www.mydomain.com/new/default.asp if they use the URL www.newstuff.com (sample). I have that domain name parked on www.mydomain.com. I'm getting the follwing error... Response object error 'ASP 0156 : 80004005' Header Error /Default.asp, line 21 <--- this is my home page The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before...
2
7815
by: Robert Gordon | last post by:
I now realize I probably should have tried posting this on the IIS board first.. I am running OWA 2003 Server as Front End server to my Exchange 2000 native domain. The FE server is secured by a 128 bit SSL cert. The OWA 2003 server is running on Windows 2003 server in a Windows 2003 native AD domain. At present, the server is configured so that user's have to specifically go to the URL httpS://myserver.company.com in order to access...
1
2713
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)
3
5524
by: ad | last post by:
Hi, The default document of IIS Virtual directory is Default.htm(not Default.aspx) Coud we use Default.htm to redirect to another page (like redirect to Default.aspx)?
7
2099
by: Frankie | last post by:
I just acquired a new customer who had an existing ASP classic Web site. When I took over, I transferred all content to ASPX pages that have different page names than the prior Web site had. I kept the original domain name. Of course, google and other search engines indexed the old site. So, while all links from search results will come to my new ASPX site, the links will be dead because of the changed page names (and I'm not about to go...
4
2386
by: Alex Maghen | last post by:
Does a call to Response.Redirect result in an immediate exit from the current page function (i.e. a "return()")? I want to make sure that the statements after the Response.Redirect() do not get called. Alex
10
9026
by: Eirik Eldorsen | last post by:
How can I 301 redirect www.example.com/default.aspx to www.example.com without using ISAPI filters?
7
8172
by: seanmatthewwalsh | last post by:
Hi I have a page (default.aspx) that pulls it's HTML from a database. I then have a "content management" page (editpage.aspx) that allows the user to edit the HTML in the database. When the user clicks the save button on editpage.aspx, the page updates the database and then redirects to the default.aspx page.
3
2740
by: =?Utf-8?B?UGF0UA==?= | last post by:
We have a site that gets many requests for nonexistent pages, files and folders. We want those requests redirected to the index page. However, for static files (i.e. images and some other extensions) we do not want to redirect and in that case want to return nothing. We had been using the 404 error page to redirect but need to discriminate the type of file being requested so that we do not return a page when an image is required. We'd...
1
7298
by: gnawz | last post by:
Hi guys, I have a couple of php files that perform various tasks. I will use fields in my system and provide code as well I need help as follows: My database contains the fields Category and Brand I need to make some changes on a a number of brands in a Category
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
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,...
0
10603
Oralloy
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...
1
10356
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,...
0
9176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7643
isladogs
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...
0
6869
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();...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.