ASP.NET
  Home arrow ASP.NET arrow ASP.NET Custom Server Controls: Cute ASP.N...
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: Cute ASP.NET TextBox Control Continued
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 16
    2005-09-12

    Table of Contents:
  • ASP.NET Custom Server Controls: Cute ASP.NET TextBox Control Continued
  • Understanding the life cycle – Rendering methods
  • Understanding the life cycle – Attributes
  • Cute Features of this control
  • Briefly understanding the JavaScript implementation

  • 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: Cute ASP.NET TextBox Control Continued


    (Page 1 of 5 )

    In my previous article, I introduced you to how to create your own TextBox control with cool features without even deriving it from an existing ASP.NET TextBox control. In this article we will further enhance the same control with new rendering features, together with client-side JavaScript emission in a most flexible manner.
    A file for this article is available for download here.

    The sample downloadable solution (zip) is entirely developed using Visual Studio.NET 2003 Enterprise Architect on Windows Server 2003 Standard Edition.  But I am confident that it would work with other versions of Windows (which support .NET 1.1) as well.

    Introduction

    My previous articles have already shown you how to create any custom control from the scratch.  Now, I will not be going into the details of creating a solution, project, etc.  I will just take this opportunity to explain the features available and how they have been implemented in the above downloadable VS.NET solution.

    In this article, I used four new methods of rendering (as opposed to only one “render” method in my previous articles).  They are as follows:

    • RenderBeginTag
    • RenderContents
    • RenderEndTag
    • AddAttributesToRender

    To be frank, all of the above methods are not really necessary for the TextBox control I developed.  But, this gives me an opportunity to explain all four simultaneously.  We can also implement all of our controls in a single “render” method as well.  But, the above methods give much more flexibility by separating various divisions of rendering.

    Now, if we don’t want to consider just the “render” method, we can forget about it completely and work on the other three methods, namely “RenderBeginTag,” “RenderContents,” and “RenderEndTag.”  In fact, the “Render” method internally calls all these methods.  “AddAttributesToRender” method is a special case, where it gets executed from within “RenderBeginTag.”

    The “RenderBeginTag” should generally be implemented with all the opening tags of the control (together with their attributes).  “RenderContents” generally contains the information which is required to be displayed (even child control information) within the same control.  Finally, “RenderEndTag” should be implemented with all the closing tags which were opened in “RenderBeginTag.”

    More ASP.NET Articles
    More By Jagadish Chaterjee


       · Hello guys, this is my article on a new version of Cute ASP.NET Textbox control. You...
     

    ASP.NET ARTICLES

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





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