programming we consider all important topic for knowledge about controls,web Services, JSON, Ajax, database, and interview related Question. In this and sql server tutorial blog we give many examples of jquery as like How Play YouTube Video in Your Website by URL, How to Play YouTube Videos in by using Jquery , Jquery Change div background on mouseover in , JQuery UI Datepicker (Calendar) etc.

Wednesday, July 30, 2014

Button Control

Deceleration Of Button in has button control and html also has a button control.for taking button control use 
<asp:Button id="button1" Text="ok " runat="server" />

.Net Provide web (server And User )controls which has facility to use controls by drag and drop on the page from toolbox.When you use this then the code is automatically generated. programming programming Button control button control properties :

  • CausesValidation: Refers if a page is validated when a button is click.
  • CommandArgument: Refers  additional information about the command to perform.
  • CommandName: Specifies the command.
  • OnClientClick:  javascript function to be executed when a button is clicked.
  • PostBackUrl:. post to from the current page when a button is clicked,some time it use two referce page .
  • Runat: define control is a server control. Must Execute Server end.
  • Text : define the text on a button.
  • UseSubmitBehavior: define whether or not a button uses the browser's submit  or the ASP.NET                                                   postback 
  • ValidationGroup: define the group of controls a button causes validation, when it posts back to the server.
  • AccessKey : refer key by Access the button control, 
  • BackColor: define backColor of button,
  •  BorderColor: define border color of Button ,
  •  BorderWidth : refer to width of border for this give value 1, 2, 3,....,
  •  Font: refer which types of font use in button text,
  •  ForeColor :refer color of font in button , 
  • TabIndex : Refer access the page by keyboard ,
  •  ToolTip: show information on button hour  , 

Create Button control with Text property : programming Button control with style button control example:

<form runat="server">
<asp:Button id="button1" Text="ok " runat="server" />
</html> button control event handlers:

code on (.aspx page)
<form runat="server">
<asp:Button id="button1" Text="ok " runat="server" onClick="button1_Click" />
code on (.aspx.cs page)
 protected void button1_Click(object sender, EventArgs e)
//Write your logic here......................

Constructors of Button control:
Button has Button() constructors .It is use for creating new object.        Button b1=new Button();
Hierarchy of Button Class

Reference :

Old Related Post Post :