473,503 Members | 2,313 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

button and post back

Hi,

Is there a way that when a button is clicked that it will run code without
doing a post back?

I have a button that when it is clicked a message box pops up from the
javascript event onbeforeunload.

However, I would like to be able to click the button and run some code
without the message box poping up

Any help would be appreciated
Brian
Nov 19 '05 #1
4 1337
Add onClick="javascript here" to the button.
"bbdobuddy" <bb*******@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
Hi,

Is there a way that when a button is clicked that it will run code without
doing a post back?

I have a button that when it is clicked a message box pops up from the
javascript event onbeforeunload.

However, I would like to be able to click the button and run some code
without the message box poping up

Any help would be appreciated
Brian

Nov 19 '05 #2
but what happens the code I want to write is Visual Basic.net code

"Scott M." wrote:
Add onClick="javascript here" to the button.
"bbdobuddy" <bb*******@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
Hi,

Is there a way that when a button is clicked that it will run code without
doing a post back?

I have a button that when it is clicked a message box pops up from the
javascript event onbeforeunload.

However, I would like to be able to click the button and run some code
without the message box poping up

Any help would be appreciated
Brian


Nov 19 '05 #3
You can't have client side code invoke server-side code without a post back
or a call to a new server page to process. There's just no way around this.
"bbdobuddy" <bb*******@discussions.microsoft.com> wrote in message
news:C2**********************************@microsof t.com...
but what happens the code I want to write is Visual Basic.net code

"Scott M." wrote:
Add onClick="javascript here" to the button.
"bbdobuddy" <bb*******@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
> Hi,
>
> Is there a way that when a button is clicked that it will run code
> without
> doing a post back?
>
> I have a button that when it is clicked a message box pops up from the
> javascript event onbeforeunload.
>
> However, I would like to be able to click the button and run some code
> without the message box poping up
>
> Any help would be appreciated
> Brian


Nov 19 '05 #4

In case you are looking for some thing like google suggest
((http://www.google.com/webhp?complete=1&hl=en) , to get server side code
execute without posting back the whole page, it is possible with XMLHTTP

there was recent MSDN article on this

http://msdn.microsoft.com/asp.net/de...outrefresh.asp

You may also want to google AJAX (Asynchronous JavaScript and XML)

sreejith

"bbdobuddy" wrote:
Hi,

Is there a way that when a button is clicked that it will run code without
doing a post back?

I have a button that when it is clicked a message box pops up from the
javascript event onbeforeunload.

However, I would like to be able to click the button and run some code
without the message box poping up

Any help would be appreciated
Brian

Nov 19 '05 #5

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

Similar topics

16
15714
by: Dave Smithz | last post by:
Hi, In summary: I want to a form to submit information via a HTTP POST, however, when using Internet Explorer I want to be able to use the back button and all the information retained....
5
2263
by: TrvlOrm | last post by:
Can any one please help me...I am new to JavaScript and I have been struggling with this code for days now and can't figure it out. I would like to get the Buttons to correspond with the action...
25
7527
by: KK | last post by:
Hi, I am using history.go(-1) for implementing the back button functionality. Its working fine but with this exception. 1. The page which is having back button has some hyperlinks on it. ...
4
17083
by: Jeremy | last post by:
I have an ASPX page with a bunch of System.Web.UI.WebControls.Button controls on it. By default, clicking on any of these causes a Postback. I'd like to have it so that for a couple of these...
7
2564
by: MgGuigg | last post by:
Hello all, This is my first time posting a question to this forum, so here is hoping I am following protocol. I am scraping the rust off my old Basic programming skills, and have just recently...
2
2374
by: ShaneFowlkes | last post by:
I created a couple of quick test pages and to my surprise, these do not work either. When I click "Go Back" on test2.aspx, nothing happens. Ideas?? Surely I must be missing something obvious........
11
4183
by: bill | last post by:
I dynamically create buttons and associate them with an event using AddHandler. I want all the button events to fire at one time, when the page is posted, instead of when each button is clicked....
1
2183
by: nileshsoni21 | last post by:
I have come across a strange behaviour in ASP or rather it could be a HTML or Browser Issue. The browser here is IE. The requirement is to re-load the page whenever user click back button of the...
23
14450
by: Bjorn | last post by:
Hi. Every time i post data in a form the contents are being checked for validity. When i click the back-button, all data is gone and i have to retype it. It's obvious that only a few or none of...
12
8075
by: jim.richardson | last post by:
Hi all, I'd like a page to be excluded from the back button history, that is, when a user hits their browser's back button, it never backs into this particular page. Can anybody please tell...
0
7194
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
7316
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...
1
6976
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
372
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.