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 / .NET Framework / General / January 2005

Tip: Looking for answers? Try searching our database.

How to click a button without re-load page ( or re-open)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Symphony - 26 Jan 2005 01:31 GMT
Hi, All:
I am using vb.net developing web application. I am new in web application.
My issue is:

I have a button "btnCalculateTotal" on a web page (form), click this button,
the "btnCalculateTotal_Click" event will calculate the total and beside the
button there is text field will show the result. but each time when I click
the button, the page will be reload and goes to the top of the page. How
should I just click the button, do not reload(or reopen) the page and show
the result right on the text field.
Cor Ligthert - 26 Jan 2005 10:19 GMT
Sympony,

the load event is always executed when there is a postback

Therefore you can test the IsPostBack if that is happening in that load
event

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemwebuipageclassispostbacktopic.asp


I hope this helps?

Cor
Symphony - 27 Jan 2005 19:01 GMT
but I think for the button on_click event, it is always load the page, how
should I click the button and do not load the page?

Thanks.

> Sympony,
>
[quoted text clipped - 8 lines]
>
> Cor
Cor Ligthert - 27 Jan 2005 19:26 GMT
> but I think for the button on_click event, it is always load the page, how
> should I click the button and do not load the page?

You cannot (when it is a serverside button).
(ASPNET is stateless, so when you do not load the page there is nothing)

However in the link I showed you is told how to overcome the load event.

Cor
Shuvro Mazumder [MSFT] - 28 Jan 2005 03:25 GMT
You might consider using a client side button whose handler code is
generated form the server side using RegisterClientScript(). You can get the
clientId of the server side text box.

Signature

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.

> > but I think for the button on_click event, it is always load the page, how
> > should I click the button and do not load the page?
[quoted text clipped - 5 lines]
>
> Cor

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.