473,386 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 16 '05 #1
1 946
"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 16 '05 #2

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

Similar topics

2
by: El Presidente | last post by:
I like the look and feel of the Microsoft AntiSpyWare applicaiton. I could envision this look and feel for a project I am currently working on. Can I do this with Visual Studio.NET 2003? Are...
55
by: Steve Jorgensen | last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of multiple parameters in a Property Let procedure to pass dimensional arguments on the basis that, although it works, it's...
1
by: PCC | last post by:
I am using the Infragistics UltraWebNavigator menu control and am having trouble building my menu hierarchy either by data binding or coding it manually. I have included a sample of my Menu table...
0
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...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
8
by: Smkmdb1 | last post by:
Hi everyone, I'm a student of ASP.net. Being an ex Perl/CGI programmer who made extra cash making scripts and selling them on the web, I was wondering if one typically uses this format with...
1
by: The Alchemist | last post by:
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...
2
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...
9
by: Mike Hofer | last post by:
In a large application I'm working on (ASP.NET 1.1, VS2003), we have a base class that wraps stored procedures. Essentially, this base class (StoredProcedureBase) encapsulates the code to set up...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...

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.