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

What is the difference between OnClick and OnServerClick in web button control

1. What is the difference between OnClick and
OnServerClick in web button control

If I have a asp button control as follows

<asp:button id="SubmitOrder" Text="Submit Order"
OnClick="OnSubmit_Click()" runat="server" >
</asp:button>

If the above is going to fire server side function what is
the difference between
OnClick and OnServerClick

2. I have function OnVerifySubmit_Click() which I would
like to run before
posting page to server

What is the correct way

<asp:button id="SubmitOrder" Text="Submit Order"
OnClick="OnVerifySubmit_Click()" runat="server" >
</asp:button>

or

In the page.load SubmitOrder.Attrubutes.Add
("onclick", "OnVerifySubmit_Click()")

Appreciate your help

Thanks
Krishna
Nov 18 '05 #1
1 6368
Onclick runs client side generated code, onserverclick runs server side
code. These hooks are provided for controls that derive from htmlcontainer
base controls.

Either will do. It's a matter of style really.

Regards

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"Krishna" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
1. What is the difference between OnClick and
OnServerClick in web button control

If I have a asp button control as follows

<asp:button id="SubmitOrder" Text="Submit Order"
OnClick="OnSubmit_Click()" runat="server" >
</asp:button>

If the above is going to fire server side function what is
the difference between
OnClick and OnServerClick

2. I have function OnVerifySubmit_Click() which I would
like to run before
posting page to server

What is the correct way

<asp:button id="SubmitOrder" Text="Submit Order"
OnClick="OnVerifySubmit_Click()" runat="server" >
</asp:button>

or

In the page.load SubmitOrder.Attrubutes.Add
("onclick", "OnVerifySubmit_Click()")

Appreciate your help

Thanks
Krishna

Nov 18 '05 #2

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

Similar topics

2
by: Vern | last post by:
I'm trying to create a custom button control, and have the onclick event close the form. I was thinking I would use this.Parent,Close() but close() isn't in the drop down list. How can I do this?
1
by: Dave | last post by:
Hi, I am using the following code to try to open a window in a target frame using a button control that is in the original frame. It does not work unless I click the button twice. If anyone...
2
by: Sedef | last post by:
Hi, i'm trying to create a custom Button user control which will be derived from System.Web.UI.WebControls.Button. the normal server side Button class creates some client side javascript code for...
2
by: Oney | last post by:
I want to open a popup window when user click the web server button control When user click the button, only OnClik="OpenWindow(12)" is sent but no event happend no popup opened.After...
3
by: Chris Dunaway | last post by:
I have derived a class from the System.Windows.Forms.Button class in order to draw the button differently. Among other things, I paint the background of the button in the OnPaing override. ...
2
by: Web learner | last post by:
In the Button control, how can I keep the ID and Text attirbute the same? Of course I can type the same thing for attributes. But I want to avoid repeated typing. <asp:Button ID="Calculate"...
0
by: David | last post by:
Hello all. I am trying to implement my first server control and have run into two problems that I cannot solve. I need the assistance of someone with more experience. My goal was to create an...
0
by: Roberto Kohler | last post by:
I created an enhanced Button Control in ASP NET 2.0 to add a delete confirmation message and to disable the button if the user does not have access. The new button control has a "ConfirmMessage"...
0
by: jagdeep gupta | last post by:
what is difference between using button as command button and as push button. If i use it as PushButton and call the event OnClick and In case of Command button i call OnCommmand event and same work...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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
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...
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
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,...
0
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...

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.