eliminates the page_load

  • Thread starter Thread starter Eitan M
  • Start date Start date
E

Eitan M

Hello,
In aspx page, whic has a server button on it.
I don't want to reload the page after I press the button.

How can I do that ?

Thanks :)
 
In this instance your "reload" = a postback methinks, and I could be
wrong, but I don't think you can prevent it. The only way I could see
would be to use a client-side html button.

I'm assuming you have a If (ispostback = true) then .... block in your
page_load event?
 
Hi Eitan:

You can check the boolean property IsPostBack in your Page_Load event
handler. If IsPostBack is false - you are doing your initial page
load, else a control is posting back to raise an event.

Make sense?
 
Scott Allen said:
Hi Eitan:

You can check the boolean property IsPostBack in your Page_Load event
handler. If IsPostBack is false - you are doing your initial page
load, else a control is posting back to raise an event.

Make sense?

--

I know the isPostBack,
and the : isPostBack is in the page_load event,
but I don't want even to go to the page_load event
(or just close the page before doing something).

Thanks :)
 
You could always use a regular <input> tag instead of a server side
button control - then do whatever processing you need with javascript.
 
O.K.
Let's say, I have a click button, that on the click I want to close the
window (client side) , and also doing update to database.

Thanks :)
 
If you want to update the database you'll have to make some sort of
request to the server. If you really want to avoid Page_Load you could
use XMLHTTP or Ajax.net to push data to the server with some custom
JavaScript. I think this would be a much more difficult task than just
using a button event handler in your page that will fire after
Page_Load, though.
 

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

Back
Top