473,898 Members | 4,077 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="OnSubm it_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="OnVeri fySubmit_Click( )" runat="server" >
</asp:button>

or

In the page.load SubmitOrder.Att rubutes.Add
("onclick", "OnVerifySubmit _Click()")

Appreciate your help

Thanks
Krishna
Nov 18 '05 #1
1 6490
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*******@disc ussions.microso ft.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="OnSubm it_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="OnVeri fySubmit_Click( )" runat="server" >
</asp:button>

or

In the page.load SubmitOrder.Att rubutes.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
2098
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
1697
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 can help I'd appreciate it. This is on a standard webform. ....................................... Private Sub btTools_Click(ByVal sender As System.Object, ByVal e_ As System.EventArgs) Handles btTools.Click
2
3299
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 its onclick event. it's something like: <input type="submit" name="Button1" value="Button" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="Button1" /> what i want to do is to be able to...
2
4031
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 that, user click again popup window is open. So user must click twice! So I must raise event twice. How can I do that or do you advice any solution? Thanks!
3
1545
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. Next I wanted the background color to change when the button was clicked so I overrided the OnMouseDown and OnMouseUp events like so: (pseudocode)
2
1229
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" runat="server" OnClick="Button_Click" /> TNK
0
1897
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 input button that would allow for both text and an image on it. I am attempting to accomplish this by basing off of the asp:button control. I added a property for the image url and one to determine if the image is displayed on the left or right...
0
2332
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" property where you can set the message you want displayed and a "SecurityKey" property to set the security key for the button. The securitykey works fine. The button is disabled if the user should not have access to it. The problem I have is...
0
1159
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 can be done in both so where is difference?
0
9993
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9841
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11265
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10949
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10484
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8036
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7187
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
4296
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3306
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.