Do a postback without updating client's page?

  • Thread starter Thread starter Guogang
  • Start date Start date
G

Guogang

In a .aspx web page, I created a button that will do a postback

What I want to do: let the button do postback, and process the postback data
in my code behind, but the client side's page won't be affected (because I
have javascript to change the web page at client side).

In C#, I need such a code:

private void btnEdit_Click(object sender, System.EventArgs e)
{
//some code to save postback data

//stop response so that client do not get a page refresh
//I tried the following:
//Response.End(); I get an empty page after postback
//Response.Close(); I get a page error because socket is closed.
}
 
There *might* be some tricky way of posting back the data inside an iframe
(don't ask me how). Apart from that, a postback involves resending to the
browser the HTML that makes up the page.
 
This is just the reason I'm looking here today.

I've created a method of doing this by using a hidden
IFrame. Instead of posting back the page, put the data
into the IFrame and post back the IFrame page. When the
IFrame page comes back it calls a javascript function and
passes the returned info.
 
Use webservice behaviors


Chuck Murison said:
This is just the reason I'm looking here today.

I've created a method of doing this by using a hidden
IFrame. Instead of posting back the page, put the data
into the IFrame and post back the IFrame page. When the
IFrame page comes back it calls a javascript function and
passes the returned info.
 
Back
Top