ASP.NET
  Home arrow ASP.NET arrow Page 2 - ASP.NET Custom Server Controls: Combining ...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

ASP.NET Custom Server Controls: Combining ImageHoverButton and RoundCorneredButton
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2005-10-31

    Table of Contents:
  • ASP.NET Custom Server Controls: Combining ImageHoverButton and RoundCorneredButton
  • Exposing properties for every side (including corners) of the button
  • Starting with the usual TABLE
  • Creating the header
  • Creating the body (content)
  • Closing the body (content) and creating the footer
  • How did I handle the post backs?
  • How is it different from my previous controls?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    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:

    • Text
    • ImageIconURL

    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). 

    More ASP.NET Articles
    More By Jagadish Chaterjee


       · Another ASP.NET control...enjoy and give me the feedback
     

    ASP.NET ARTICLES

    - More Advanced ASP.NET 3.5 Functions and Subr...
    - ASP.NET 3.5 Functions and Subroutines
    - Coding an IQ Test with Conditionally Driven ...
    - Developing Conditionally Driven Event Handle...
    - ASP.NET 3.5 Debugging Using Visual Web Devel...
    - Understanding Event Handlers in ASP.NET 3.5
    - Building a Web Form in ASP.NET and PHP: a Co...
    - Inserting Data into a Microsoft SQL 2008 Dat...
    - Creating an ASP.NET Dynamic Web Page Using M...
    - Retrieving Data from Microsoft SQL Server 20...
    - Building ASP.NET Web Forms to Use a MySQL Da...
    - Creating an ASP.NET Database using MS SQL 20...
    - Building an ASP.NET Website Using Include Ta...
    - Create ASP.NET Web Forms to Use a Microsoft ...
    - Editing Web Design Layout in Visual Web Deve...





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 12 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek