Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Prevent round trip of postback

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
moondaddy - 12 Sep 2007 22:14 GMT
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.

Signature

moondaddy@newsgroup.nospam

Göran Andersson - 12 Sep 2007 22:43 GMT
> 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
[quoted text clipped - 3 lines]
> 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.

Signature

Göran Andersson
_____
http://www.guffa.com

Steven Cheng[MSFT] - 13 Sep 2007 03:58 GMT
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.

--------------------
>Date: Wed, 12 Sep 2007 23:43:06 +0200
>From: =?ISO-8859-1?Q?G=F6ran_Andersson?= <guffa@guffa.com>
>User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
>MIME-Version: 1.0
>Subject: Re: Prevent round trip of postback

>> 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
[quoted text clipped - 14 lines]
>code example for AJAX has code that sends a request using XMLHTTP and
>gets the response as a string.
moondaddy - 05 Oct 2007 16:04 GMT
Thanks Steven this is what I was looking for.  And also thanks to Göran as I
will ultimately end up using his suggestion.

> Hi Moondaddy,
>
[quoted text clipped - 56 lines]
>>code example for AJAX has code that sends a request using XMLHTTP and
>>gets the response as a string.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.