ASP.NET Custom Server Controls: Combining ImageHoverButton and RoundCorneredButton - Exposing properties for every side (including corners) of the button
(Page 2 of 8 )
As you know, every side of the button needs to be provided with some image (even corners, of course). The following are the properties which handle all of those images (paths of those images).
Property ImageTopLeftURL() As String
Property ImageTopMiddleURL() As String
Property ImageTopRightURL() As String
Property ImageMiddleLeftURL() As String
Property ImageMiddleMiddleURL() As String
Property ImageMiddleRightURL() As String
Property ImageBottomLeftURL() As String
Property ImageBottomMiddleURL() As String
Property ImageBottomRightURL() As String
I hope all of the above are simple to read and understand. I declared each of those properties with an attribute at the top as follows:
<EditorAttribute(GetType(System.Web.UI.Design.UrlEditor), GetType
(System.Drawing.Design.UITypeEditor))>
The above is the most exciting statement used with all the above properties. The “EditorAttribute” is mainly helpful for the Visual Studio.NET designer to facilitate an editor for the value being provided to that property (similar to the “Font” property).
In this case, we attach a dialog box (a Visual Studio.NET supported open dialog) for the property, to facilitate the developer in selecting the respective image from folders within the web application hierarchy. If we don’t specify the above attribute, the developer needs to remember and type the entire path of the image within the property window of Visual Studio.NET designer, as opposed to simply selecting the image file.
Apart from all of the above, I also implemented the following properties:
I hope you can easily understand the “Text” property. It just displays the information and centers it to the button. The “ImageIconURL” property is used to specify the icon, which gets displayed just before the text (generally used for OK, SAVE, NEW, CANCEL, and similar buttons).
Next: Starting with the usual TABLE >>
More ASP.NET Articles
More By Jagadish Chaterjee