473,396 Members | 2,109 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,396 software developers and data experts.

Which event will be called ? How the flow goes... ?

My platform is .Net 1.1(ASP.Net)

for a button I have the following code

1. In the page load I am injecting the client script as follows
MyButton.Attributes.Add("onClick", "CallingJavaFunction")
Where "CallingJavaFunction" is the name of the Java function.

2. also for the clicked event I have the code as follows.

Private Sub MyButton_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles MyButton.Click

'Do some work here

End Sub

Which sequence the code will be called ? Thanks for your advice. Pointing
to any resource which explains this will be of great help.
-Gill

Nov 18 '05 #1
2 854
Hi Gill,

The Page_Load event will ALWAYS be called every time the page is accessed.
You can test whether it's not a postback (i.e. the first time the page is
accessed) by:

If Not IsPostback Then
...Do Stuff here only for the first time the page is accessed
End If

THEN----if the button was clicked will the Click event be called.

Hope this helps.

Jeff Tolman
je*********@enm.com
"Gill Smith" <gi*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
My platform is .Net 1.1(ASP.Net)

for a button I have the following code

1. In the page load I am injecting the client script as follows
MyButton.Attributes.Add("onClick", "CallingJavaFunction")
Where "CallingJavaFunction" is the name of the Java function.

2. also for the clicked event I have the code as follows.

Private Sub MyButton_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles MyButton.Click

'Do some work here

End Sub

Which sequence the code will be called ? Thanks for your advice. Pointing
to any resource which explains this will be of great help.
-Gill

Nov 18 '05 #2
By doing this,
MyButton.Attributes.Add("onClick", "CallingJavaFunction")
You are attaching client side onclick event. So when the button is presses,
first client side event will be fired. Then it will come to server, where
you "MyButton_Click" event will fire.

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Gill Smith" <gi*******@hotmail.com> wrote in message
news:#G**************@TK2MSFTNGP12.phx.gbl...
My platform is .Net 1.1(ASP.Net)

for a button I have the following code

1. In the page load I am injecting the client script as follows
MyButton.Attributes.Add("onClick", "CallingJavaFunction")
Where "CallingJavaFunction" is the name of the Java function.

2. also for the clicked event I have the code as follows.

Private Sub MyButton_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles MyButton.Click

'Do some work here

End Sub

Which sequence the code will be called ? Thanks for your advice. Pointing
to any resource which explains this will be of great help.
-Gill

Nov 18 '05 #3

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

Similar topics

2
by: alanrn | last post by:
For all you seasoned VB programmers this is going to be a no brainer. However, as a C programmer learning VB I'm having trouble getting my arms around the event-driven nature of VB. Suppose I...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
9
by: VK | last post by:
My original idea of two trains, however pictural it was, appeared to be wrong. The truth seems to be even more chaotic. IE implements its standard down-up model: any mouse event goes from the...
6
by: Dhananjaya.R | last post by:
Hi, What will be the constructor flow of control for the below snippet. I had an hard time understanding how C# can allow initialization of member variables in class declaration. public class...
2
by: John Dalberg | last post by:
I need to know what happens after Page_load has finished so I put a breakpoint at the last statement. However after stepping into after this last statement, the app continues running without the...
8
by: wASP | last post by:
Hi, I'm having a problem referencing the elements within an object after a method of that object (a member function) has been activated with an onsubmit handler: - - - - - - - - ...
3
by: =?Utf-8?B?Um9sYW5kcGlzaA==?= | last post by:
Hi, I'm doing an application using C# and I have this question: I have a method called sqlQueryBD which receives a string sql query and executes it against a database. I also have a class called...
8
by: Louis | last post by:
I was trying to display a custom context menu in javascript. I wanted to capture a right mouse click. I added an eventListener to a "div" like this.. element,addEventListener ("click", myfunc,...
4
by: tshad | last post by:
I am just getting started with events and had a couple of questions on why they do what they do. If you have a textbox and you want to handle an event you can just do: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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...

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.