| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ImageButton ClassSystem.Web.UI.WebControls Namespace Renders an image that responds to mouse clicks.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Visibility | Name | Value Type | Accessibility |
|---|---|---|---|
| public | CausesValidation | Boolean | [ Get , Set ] |
| public | CommandArgument | String | [ Get , Set ] |
| public | CommandName | String | [ Get , Set ] |
| public | Enabled | Boolean | [ Get , Set ] |
| public | GenerateEmptyAlternateText | Boolean | [ Get , Set ] |
| public | OnClientClick | String | [ Get , Set ] |
| public | PostBackUrl | String | [ Get , Set ] |
| public | ValidationGroup | String | [ Get , Set ] |
| Visibility | Name | Parameters | Return Type |
|---|---|---|---|
| protected | AddAttributesToRender | ( HtmlTextWriter writer ) | Void |
| protected | GetPostBackOptions | ( ) | PostBackOptions |
| protected | LoadPostData | ( String postDataKey , NameValueCollection postCollection ) | Boolean |
| protected | OnClick | ( ImageClickEventArgs e ) | Void |
| protected | OnCommand | ( CommandEventArgs e ) | Void |
| protected | RaisePostBackEvent | ( String eventArgument ) | Void |
| protected | RaisePostDataChangedEvent | ( ) | Void |
| Multicast | Name | Type |
|---|---|---|
| multicast | Click | ImageClickEventHandler |
| multicast | Command | CommandEventHandler |
Use the ImageButton control to display an image that responds to mouse clicks. An ImageButton can be used either as a submit or command button that posts the page back to the server.
By default, an ImageButton control is a submit button, which simply posts the Web page back to the server. To programmatically control the action performed when the imagebutton is clicked, you define an event handler for the imagebutton's Click event.
Unlike the Button and LinkButton controls, though, you can programmatically determine the coordinates where the image is clicked. You can then code a response based on the values of the coordinates. Note the origin ( 0, 0 ) is located at the upper left corner of the image.
A command imagebutton, on the other hand, is an ImageButton control that can be used to invoke commands. This is basically done by associating the imagebutton with a CommandName ( ex. select, sort, edit, update, delete, etc. ). This allows you to create multiple ImageButton controls on a Web page and programmatically determine which imagebutton is clicked.
An optional CommandArgument property can be used with a command imagebutton to provide additional information about the command to perform ( ex. ascending ). Likewise, to programmatically control the actions performed when the command imagebutton is clicked, you define an event handler for the imagebutton's Command event.
For examples illustrating use of this control, see the individual member types of this class. For syntax information, see ImageButton in ASP.NET Syntax for Web Controls.
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme