Prevent round trip of postback

M

moondaddy

I have an htm page that will be passing data to the server via parameters in
a hidden iframe's aspx page. I not need the aspx page to return back to the
htm page because the mission has already been accomplished in the initial
page load event. also, this is not critical data so I don't need to notify
the use if something failed. After I execute the needed code in the page
load event, how can I cancel the operation to prevent anything going back to
the client?

Thanks.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

moondaddy said:
I have an htm page that will be passing data to the server via parameters in
a hidden iframe's aspx page. I not need the aspx page to return back to the
htm page because the mission has already been accomplished in the initial
page load event. also, this is not critical data so I don't need to notify
the use if something failed. After I execute the needed code in the page
load event, how can I cancel the operation to prevent anything going back to
the client?

You can't really cancel a request, there is always a response to a
request as long as the server is working properly. The server can send
an http error back, but that is also a response.

Why don't you want a response? You can just send a response that
contains a simple string like "ok".

I would suggest that you use XMLHTTP instead of a hidden iframe. Any
code example for AJAX has code that sends a request using XMLHTTP and
gets the response as a string.
 
S

Steven Cheng[MSFT]

Hi Moondaddy,

I think this case is the same to those other threads you've posted, correct?

If so, I think get additional response text should not be a problem since
you're using a hidden <iframe> so that no one will see it. If what you
concern is to reduce the response data(avoid useless data transfer), you
can use Response.End to stop the communiation after you've done the work.
e.g.

==========
protected void Page_Load(object sender, EventArgs e)
{
//do your work here

Response.End();
}
=========

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.




--------------------
 
M

moondaddy

Thanks Steven this is what I was looking for. And also thanks to Göran as I
will ultimately end up using his suggestion.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top