473,661 Members | 2,429 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.H tmlTextWriter. 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 786
"The Alchemist" <al*******@lyco s.com> wrote in message
news:ee******** *************** **@posting.goog le.com...
The 'Render' method of a Web Custom Control takes an argument 'output'
of type System.Web.UI.H tmlTextWriter. 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
johnwsaundersii i at hotmail
Nov 20 '05 #2

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

Similar topics

0
1616
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 submitted the same Query but i got replay for user controls,but my requirement is not that one.My requirement is Custom web controls.
2
2089
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 base all my custom controls on this new MyUserControl Class. Is this the way to go? The MyUserControl would not actually have any UI component and should be abstract I think. Does this mena that I should not create the control by just selecting...
0
955
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 it possible to access its get properties in the code behind file like with a server control? If it is not an assembly, how do I begin to reference my control?
3
1052
by: Billy Porter | last post by:
Any ideas? -- Thanks, Billy
6
2665
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 controls periodically disappear from my project when I build it. First of I get the message about a missing dependency, then if I rebuild after that - the control just physically disappears from the form, and I get an object not found error when I
2
2578
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 good while and I'm getting really frustrated now! My problem is this - my custom controls periodically disappear from my
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 overhead. ( i mean these drop down lists are used a lot in different places which i think would warrant custom control drop down lists). and the table lookups are to basically 1 or 2 tables. would that mean 6 different connections would be open? just...
2
1531
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 practice for configuring a custom control. As far as I can say, I have the following alternatives: - Defining properties for the control, and setting these in the ASPX
1
2176
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 controls. Only problem is that I'm used to designing my controls in a WYSIWYG (tm) way (i.e. using the designer and writing HTML tags). The only way I found to create custom controls was to create controls dynamically, set their properties and...
2
1810
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 knowledge about writing custom controls which can also be used by sharepoint as I know absolutely nothing about sharepoint. thanks
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8754
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8542
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2760
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1740
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.