473,508 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question on building Web Custom Controls

The 'Render' method of a Web Custom Control takes an argument 'output'
of type System.Web.UI.HtmlTextWriter. This HtmlTextWriter renders any
content in the 'Render' method.

I am trying to render the content of my control in ANOTHER method.
When I try to create a new HtmlTextWriter in that method with the
code:

Dim writer As New StringWriter
Dim output2 As New HtmlTextWriter(writer)
output2.Write("TEST")

....it does nothing. This method is being called by another control to
in order to render some content. Can someone please advise how I can
render content from a custom method in a Web Custom Control.

Thanks in advance for any help.
Nov 20 '05 #1
1 774
"The Alchemist" <al*******@lycos.com> wrote in message
news:ee*************************@posting.google.co m...
The 'Render' method of a Web Custom Control takes an argument 'output'
of type System.Web.UI.HtmlTextWriter. This HtmlTextWriter renders any
content in the 'Render' method.

I am trying to render the content of my control in ANOTHER method.
When I try to create a new HtmlTextWriter in that method with the
code:

Dim writer As New StringWriter
Dim output2 As New HtmlTextWriter(writer)
output2.Write("TEST")

...it does nothing. This method is being called by another control to
in order to render some content. Can someone please advise how I can
render content from a custom method in a Web Custom Control.


What is the value of writer.ToString() after the Write? You may also need to
use output2.Flush() before you see the result.
--
John Saunders
johnwsaundersiii at hotmail
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1607
by: Jai | last post by:
Dear All Creating Custom Controls but Not User Controls,How to create custom controls,i.e Extending the functionality of the Existing Controls.(Web Custom Controls). Previously i have...
2
2077
by: John B | last post by:
Hello I want to create a set of controls that have some common methods and properties. I was thinking that I should subclass the UserControl class and add these common features there and then...
0
948
by: chris fink | last post by:
Hello, Is is possible to control a custom control like the asp.net server controls without making it into an assembly? For example, if my custom control was named <MYCONTROL:CONTROL1 .....> is...
3
1046
by: Billy Porter | last post by:
Any ideas? -- Thanks, Billy
6
2650
by: Suzanne | last post by:
Hi all, I really hope someone out there can help me as I've been tearing my hair out on this one for a good while and I'm getting really frustrated now! My problem is this - my custom...
2
2564
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
8
271
by: rodchar | last post by:
hey all, i was wondering if this was worth doing or what implications might be. if i had a form that has 6 or more table lookups inside drop down lists would 6 custom controls be a lot of...
2
1526
by: Laurent Bugnion | last post by:
Hi, I like to develop custom controls for a number of webpages. These controls are often customizable, so that they can be reused in a number of situations. My question is: What is the best...
1
2169
by: Abdo Haji-Ali | last post by:
Previously I used to create user controls if I wanted to use a specific set of controls in multiple pages, however I want to deploy my control in other applications so I thought of creating custom...
2
1807
by: Microsoft Newsserver | last post by:
I have a requuirement to build a control with custom functionality for our ..net web applications. We are also being asked if this could beused in sharepoint as well. Does anyone have any...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7118
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5625
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.