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

Output
Output

All of the code that we will use to display information will be added to the Render.

You will notice that the Render method takes an HTMLTextWriter as a parameter, this output object can be used to write the appropriate information -

output.AddAttribute("border", "1")
output.AddStyleAttribute("border-color", "#000000")
output.RenderBeginTag("table")
output.Write(Text)
output.RenderEndTag()

That code will print out the following HTML -

<table border="1" style="border-color:#000000;">
Hello There
</table>

Let's go over these methods.


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
Comment:
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
Comment:
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
Comment:
Excellent topic and well explained.

Product Spotlight
Product Spotlight 





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


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-24 1:56:16 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search