"Server.Transfer(Request.FilePath);" make server re-evaluate current
page. In debugger, I found that though the page's OnPreInit is called,
delegates attached in HttpModule is not executed. Why ASP.NET is
designed in such a way?
To make the page executed from scratch, I have to use
Resposne.Redirect(Request.FilePath), but this will waste a networking
roundtrip. 3 2480
Thats because your already within the bounds of the asp.net request pipeline
and by using transfer your effectively saying you want to stay within the
pipeline, all your really doing is transferring the page request to a
sub-request not intiating a new one. Redirtect takes you out of the asp.net
pipeline and forces a new request, hence resulting in the behaviour you
need.
Regards
John Timney (MVP) http://www.johntimney.com http://www.johntimney.com/blog
"Morgan Cheng" <mo************@gmail.comwrote in message
news:11*********************@y5g2000hsa.googlegrou ps.com...
"Server.Transfer(Request.FilePath);" make server re-evaluate current
page. In debugger, I found that though the page's OnPreInit is called,
delegates attached in HttpModule is not executed. Why ASP.NET is
designed in such a way?
To make the page executed from scratch, I have to use
Resposne.Redirect(Request.FilePath), but this will waste a networking
roundtrip.
I tried to Server.Transfer to another aspx page in same server. The
PreInit event is still not triggerred.
So, we cannot put page related stuff in PreInit handler, right?
On Apr 29, 9:10 pm, "John Timney \(MVP\)"
<x_j...@timney.eclipse.co.ukwrote:
Thats because your already within the bounds of the asp.net request pipeline
and by using transfer your effectively saying you want to stay within the
pipeline, all your really doing is transferring the page request to a
sub-request not intiating a new one. Redirtect takes you out of the asp.net
pipeline and forces a new request, hence resulting in the behaviour you
need.
Regards
John Timney (MVP)http://www.johntimney.comhttp://www.johntimney.com/blog
"Morgan Cheng" <morgan.chen...@gmail.comwrote in message
news:11*********************@y5g2000hsa.googlegrou ps.com...
"Server.Transfer(Request.FilePath);" make server re-evaluate current
page. In debugger, I found that though the page's OnPreInit is called,
delegates attached in HttpModule is not executed. Why ASP.NET is
designed in such a way?
To make the page executed from scratch, I have to use
Resposne.Redirect(Request.FilePath), but this will waste a networking
roundtrip.
No - I dont think you can as you are not re-entering the event pipeline at
the start of a request
Regards
John Timney (MVP) http://www.johntimney.com http://www.johntimney.com/blog
"Morgan Cheng" <mo************@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
>I tried to Server.Transfer to another aspx page in same server. The
PreInit event is still not triggerred.
So, we cannot put page related stuff in PreInit handler, right?
On Apr 29, 9:10 pm, "John Timney \(MVP\)"
<x_j...@timney.eclipse.co.ukwrote:
>Thats because your already within the bounds of the asp.net request pipeline and by using transfer your effectively saying you want to stay within the pipeline, all your really doing is transferring the page request to a sub-request not intiating a new one. Redirtect takes you out of the asp.net pipeline and forces a new request, hence resulting in the behaviour you need.
Regards
John Timney (MVP)http://www.johntimney.comhttp://www.johntimney.com/blog
"Morgan Cheng" <morgan.chen...@gmail.comwrote in message
news:11*********************@y5g2000hsa.googlegro ups.com...
"Server.Transfer(Request.FilePath);" make server re-evaluate current
page. In debugger, I found that though the page's OnPreInit is called,
delegates attached in HttpModule is not executed. Why ASP.NET is
designed in such a way?
To make the page executed from scratch, I have to use
Resposne.Redirect(Request.FilePath), but this will waste a networking
roundtrip.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: jespey |
last post by:
I have a handler that takes an incoming request and does aserver.transfer to an appropriate aspx page. I then usejavascript in the onSubmit for the form to change action to theoriginally requested...
|
by: Alexander Bosch |
last post by:
Hi,
I'm having a problem similar to the one that's stated in this KB
http://support.microsoft.com/default.aspx?scid=kb;en-us;839521
When I'm posting a page to itself with the bool value as true it...
|
by: kaburke |
last post by:
Is there a way to make a page at the receiving end of a Server.Transfer
think that the request is a Postback? (When I say "think it is a Postback,"
I mean I want the page to go through the ENTIRE...
|
by: Marcelo Cabrera |
last post by:
Hi,
I have a user control that in turn creates a bunch of webcontrols
dynamically and handles the events these webcontrols raise. It used to work
fine on ASP .Net 1.1 but when compiled on 2.0 it...
|
by: Richard |
last post by:
I've developed a small ASPX template framework (based on Chun Li's
article on CodeProject:
http://www.codeproject.com/aspnet/headerfooter.asp#xx849313xx) which
uses a IHttpModule to apply...
|
by: David Veeneman |
last post by:
I want to programmatically create some POST data on a web server, then pass
that data to another web page that the server calls, using
Server.Transfer(). What's the best way to do that?
I'm...
|
by: Rachel |
last post by:
We recently upgraded to ASP.NET 2 AJAX Beta 2 an since we are encountering
the following problem:
STEPS:
1- navigate to a page containing a UpdatePanel using SERVER.TRANSFER
2- click on a...
|
by: Rahul |
last post by:
this is my code in preinit event
I have "hlinkAdd" as hyperlink web control and i am using a master page, and
below code is of content page preinit event.
Protected Sub Page_PreInit(ByVal sender...
|
by: scarng |
last post by:
I have a form that has multiple tabs. Each tab contains specific information for the record chosen. One Tab has a function that returns the distinct record from another table based on the initial...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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,...
| |