Introducing Custom Controls
page 6 of 6
by . .
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 27485/ 48

Additional Methods


This method takes in the name of the attribute and the value of it. In the above example I passed in border for the name and 1 for the value.


This method takes in the name of the style property and the value of it. Using this method, it properly formats your style attribute without you having to mess around with it and probably get a syntax error along the way.


These two methods start rendering and stop rendering the tag specified by RenderBeginTag. Using these methods take some adjustment, but in the end they present properly formatted code. They also allow you to make the code more dynamic (easier than having a lot of ' "something" & varname & "something" ') with ease.


This article has barely scratched the surface of custom controls, in future articles, I will show you more about advanced custom controls and other things that you can do with them.

View Entire Article

User Comments

Title: Custom vs. User control BLUNDER – user control CAN be referenced in the code.   
Name: Igor Kikena
Date: 2005-03-14 3:53:38 PM
Implementing page can reference user control exactly the same way as custom control, otherwise there is really little use for them. And Yes, it does not create user control variable when you drag and drop it on the page, contrary to custom control. So leave your mouse alone and strike the damn keyboard and enjoy user controls in the code behind.

Igor Kikena
Title: Ok..Its a good Topic   
Name: Esha
Date: 2005-03-08 4:47:14 AM
I will be better if u give an sample code for building custom control and embedding it in asp webform page
Title: airo   
Name: airo
Date: 2005-01-13 10:13:47 PM
Excellent topic and well explained.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2021  |  Page Processed at 2021-02-27 4:15:16 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search