473,770 Members | 6,348 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Server.Transfer fails because httpcontext.cur rent = nothing

Hi,
I'm using Threads, and when I try to do Server.Transfer , I recieved an
error. (child object does not exist...)

My Code:

Dim t As New Thread(AddressO f Hilo)

Private Sub Hilo()
Thread.Sleep(10 00)
Server.Transfer ("Index.aspx ")
end Sub

In Page Load I use:
t.Start()

The Thread works fine, but fails in Server.Transfer . I notice
Httpcontext.cur rent is nothing inside "Private Sub Hilo()", but it isn't in
PageLoad, so the sentence Server.Transfer fails.
I've tried to declare a httpcontext variable and set the value of
httpcontext.cur rent in page load.
i.e. Dim HT as httpcontext

And inside PageLoad:
HT = httpcontext.cur rent.

It works in pageload, but inside Sub Hilo, HT is nothing as well.

Any Idea?
Oct 24 '07 #1
2 3118
your page sent its response and its context was released before the
thread completed. in prerender you should do a join back to the thread.
this way the thread an send data to the browser.

-- bruce (sqlwork.com)

albertosoria wrote:
Hi,
I'm using Threads, and when I try to do Server.Transfer , I recieved an
error. (child object does not exist...)

My Code:

Dim t As New Thread(AddressO f Hilo)

Private Sub Hilo()
Thread.Sleep(10 00)
Server.Transfer ("Index.aspx ")
end Sub

In Page Load I use:
t.Start()

The Thread works fine, but fails in Server.Transfer . I notice
Httpcontext.cur rent is nothing inside "Private Sub Hilo()", but it isn't in
PageLoad, so the sentence Server.Transfer fails.
I've tried to declare a httpcontext variable and set the value of
httpcontext.cur rent in page load.
i.e. Dim HT as httpcontext

And inside PageLoad:
HT = httpcontext.cur rent.

It works in pageload, but inside Sub Hilo, HT is nothing as well.

Any Idea?
Hi,
I'm using Threads, and when I try to do Server.Transfer , I recieved an
error. (child object does not exist...)

My Code:

Dim t As New Thread(AddressO f Hilo)

Private Sub Hilo()
Thread.Sleep(10 00)
Server.Transfer ("Index.aspx ")
end Sub

In Page Load I use:
t.Start()

The Thread works fine, but fails in Server.Transfer . I notice
Httpcontext.cur rent is nothing inside "Private Sub Hilo()", but it isn't in
PageLoad, so the sentence Server.Transfer fails.
I've tried to declare a httpcontext variable and set the value of
httpcontext.cur rent in page load.
i.e. Dim HT as httpcontext

And inside PageLoad:
HT = httpcontext.cur rent.

It works in pageload, but inside Sub Hilo, HT is nothing as well.

Any Idea?

Oct 24 '07 #2
Hi Bruce,

I can't do a join back, because I need the aspx page was loaded completely,
so I use the thread in that way.

I explain you what I want to do.

The Page I'm loading has an <IFRAMEtag with a form inside which is
submited automatically in OnLoad Event, just after its fields are filled with
hidden values.

The form is submitied to an external server, and this external server
inserts a data in a database.

My page must be waiting until the data was intersed, and then, not before, I
have to do a response.redire ct or server.transfer to another page.

I use a thread to be searching in the database to know when the data has
been inserted.
"bruce barker" wrote:
your page sent its response and its context was released before the
thread completed. in prerender you should do a join back to the thread.
this way the thread an send data to the browser.

-- bruce (sqlwork.com)

albertosoria wrote:
Hi,
I'm using Threads, and when I try to do Server.Transfer , I recieved an
error. (child object does not exist...)

My Code:

Dim t As New Thread(AddressO f Hilo)

Private Sub Hilo()
Thread.Sleep(10 00)
Server.Transfer ("Index.aspx ")
end Sub

In Page Load I use:
t.Start()

The Thread works fine, but fails in Server.Transfer . I notice
Httpcontext.cur rent is nothing inside "Private Sub Hilo()", but it isn't in
PageLoad, so the sentence Server.Transfer fails.
I've tried to declare a httpcontext variable and set the value of
httpcontext.cur rent in page load.
i.e. Dim HT as httpcontext

And inside PageLoad:
HT = httpcontext.cur rent.

It works in pageload, but inside Sub Hilo, HT is nothing as well.

Any Idea?
Hi,
I'm using Threads, and when I try to do Server.Transfer , I recieved an
error. (child object does not exist...)

My Code:

Dim t As New Thread(AddressO f Hilo)

Private Sub Hilo()
Thread.Sleep(10 00)
Server.Transfer ("Index.aspx ")
end Sub

In Page Load I use:
t.Start()

The Thread works fine, but fails in Server.Transfer . I notice
Httpcontext.cur rent is nothing inside "Private Sub Hilo()", but it isn't in
PageLoad, so the sentence Server.Transfer fails.
I've tried to declare a httpcontext variable and set the value of
httpcontext.cur rent in page load.
i.e. Dim HT as httpcontext

And inside PageLoad:
HT = httpcontext.cur rent.

It works in pageload, but inside Sub Hilo, HT is nothing as well.

Any Idea?
Oct 25 '07 #3

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

Similar topics

0
2074
by: Srini | last post by:
I am implementing Front Controller in ASP.net as outlined in Microsoft documentation titled "Implementing Front Controller in ASP.NET Using HTTPHandler" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpFrontControllerInASP.asp Everything works well except for context.server.transfer(string url) method (refer to RedirectingCommand.cs class in the above documentation) Here are the error details Server...
2
3442
by: Mauricio | last post by:
Hi! I´m using a custom handler with an ASP.NET application using the Front Controller pattern. But I´m experiementing some problems with the following line of code: context.Server.Transfer(url);
1
3495
by: Victor Song | last post by:
Hi We are trying to stream a file using server.transfer rather than response.redirect. We have it working for IIS 5.0 but IIS 6.0 refusing to let us transfer the file. If we do the less efficient prompt/response technique to the browser both work fine. We found this article that was only slightly appicable (ms-help://MS.MSDNQTR.2004APR.1033/enu_kbiis/iis/326965.ht kb 326965 ) but since csv is already a defined mime type this shouldn't...
10
12207
by: GreggTB | last post by:
I've got an page (LOGIN.ASPX) that receives the user's login information. During the page load, it checks the credentials against a database and, if validation is successful, creates an instance of an object that stores the user's basic profile data (username, user type, associated sales region, etc.). I've been taking this user info and placing it in the Session object like so... Session = user;
3
1953
by: Steve Lutz | last post by:
Hello All, I have an ASPX page whose class inherits from a company global base page. The company base page has a property call PageTitle (string) that is assigned by all the pages. The base class also includes a class that is used for logging. This logging class uses HttpContext.Current.Handler to get the instance of the page. In this way, it can get the PageTitle property.
8
3901
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really need to avoid the extra round-trip to the client. I've tried Passing the page name, the full URL, and the instance of the handler class to the Transfer method, but everything gets me the same error 500. Any help would be appreciated.
0
1089
by: fabrice | last post by:
Hello, I have got a little problem with Url Rewritig process and server.transfer use. I would like to create a simple url rewriting process for my web site I use in a lot of pages, the "server.transfer" property to go to one page to another one. In this process, I use the global.asax with Application_BeginRequest Sub. I need to catch the whole url with querystring if exists.
2
1689
by: Fabrice | last post by:
Hello Does a solution exist to get always the right path when you use Server.Transfer in web application (version 1.1) ? I want to rewrite my URL by use Global.asax and Application_BeginRequest Sub. But as i use server.transfer in my web application i get always the old URL even if i use the property "HttpContext.Current.Request.CurrentExecutionFilePath".
1
2995
by: =?Utf-8?B?c2hldWVydHo=?= | last post by:
Hi, I'm developing a reporting app that works as a subordinate to other apps, ie, users still see the menu structure for the app they're working in, but generate their report in my app. When the user selects the menu option for my report, they go through a session transfer page, and they are Response.Redirect'ed to my app. This works fine. However, on the index.aspx page of my app, when they click a report, or generate a new report,...
0
10225
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...
0
10053
jinu1996
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...
1
10001
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
9867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8880
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
7415
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
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3969
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
2
3573
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.