473,385 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

eliminates the page_load

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 :)
Nov 19 '05 #1
6 912
Roy
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?

Nov 19 '05 #2
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
http://www.OdeToCode.com/blogs/scott/

On Mon, 6 Jun 2005 00:43:49 +0200, "Eitan M" <no****@nospam.com>
wrote:
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 :)


Nov 19 '05 #3

"Scott Allen" <sc***@nospam.odetocode.com> wrote in message
news:29********************************@4ax.com...
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 :)
Nov 19 '05 #4
You could always use a regular <input> tag instead of a server side
button control - then do whatever processing you need with javascript.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 6 Jun 2005 15:04:56 +0200, "Eitan M"
<no_spam_please@nospam_please.com> wrote:

"Scott Allen" <sc***@nospam.odetocode.com> wrote in message
news:29********************************@4ax.com.. .
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 :)


Nov 19 '05 #5
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 :)
Nov 19 '05 #6
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.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Tue, 7 Jun 2005 18:57:15 +0200, "Eitan M" <no****@nospam.com>
wrote:
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 :)


Nov 19 '05 #7

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

Similar topics

1
by: bminder | last post by:
In the asp.net pages below, Common.vb has an overridable Page_Load sub. In the consuming page, Two.aspx, the Page_Load sub is inherited, but for some reason it (Overrides Sub Page_Load) executes...
3
by: DavidS | last post by:
Have parent.aspx from which I open Driver.aspx form via button on parent.aspx. When I first open the modal dialog, the driver.aspx Page_Load function is called. After I close the dialog, then...
0
by: Itai | last post by:
Background: I have four Web Form pages with respective C# code behind files, all in the same project: localhost/vpath1 Page1.aspx Page2.aspx
14
by: V. Jenks | last post by:
I'm a little rusty having not touched .NET for 6 months and I can't remember why Page_Load is happening twice in this code: private void Page_Load(object sender, System.EventArgs e) {...
4
by: tshad | last post by:
Is there a way to do put Page_loads on a page? I am trying to setup a Page_Load that just puts a persons name that is logged on at the top of a page the first time a page is loaded. In my...
4
by: Seraph | last post by:
Again, I'm rather new here, so if I fail to follow any etiquette, please forgive me and let me know what I've done wrong, but I think this might interest quite a few people. One of my colleaques...
5
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page myadd.dll - Contains PageBase which inherits...
1
by: rockdale | last post by:
Hi, I have a masterpage and on the page_load event I Populate my mainmenu from database. I the page_load event of my content, I am trying to programmly select the menuitem that represent...
11
by: fiefie.niles | last post by:
I am using ASP.NET 2005 and I have a simple form. Page_Load calls a sub mySub that does not do anything (for testing purposes). But, Page_Load gets called twice. On every single ASPX page in my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.