NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ImageButton Web Control

The ImageButton control enables you to to trap user clicks within an image, which gives you an image map-like facility.

ASP+ Syntax

Required properties are noted in boldface type.

<asp:ImageButton id="ImageButton1" runat="server"
   ImageUrl="string"
   Command="command"
   CommandArgument="commandArgument"
   OnClick="OnClickMethod"
/>
Note   Because the <asp:ImageButton> element has no content, you can close it with />.

Properties

Property Description
(Base control properties) The properties defined in Base Web Control Properties.
ImageUrl The URL of the image to display.
CommandArgument Optional command argument used in conjunction with the value of the Command property. Contains a value that should be bubbled when the image button is clicked. For example, if the Command property is set to "Sort," the CommandArgument property might be set to "Ascending" or "Descending."
Command Command that should be bubbled when a button embedded in a container control is clicked. The value set in this property is available as an argument of the OnItemCommand event of the container control. For example, if the ImageButton control is in a DataList control, the Command might be set to "Sort." You can pass additional information using the CommandArgument property.

Events

Event (and paramters) Description
OnClick(Object sender, ImageClickEventArgs e) Raised when the user clicks the button. This event always causes the page to be posted to the server.

Properties of the e event argument object:

  • e.x   (integer) X coordinate where click took place.
  • e.y   (integer) Y coordinate where click took place.

Example

To be supplied.

See Also

Web Forms Controls by Function |