472,378 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 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 6213
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.