473,778 Members | 6,976 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Render the asp: markup from a WebControl


Hi everybody,

I'm new to codecomments, but I really hope someone can help me.

I am dynamically loading custom controls and user controls into my
htmlform control. As I have a lot of "custom" data and controls to use,
I am basically creating a string with the markup, using
Page.ParseContr ol to obtain this as a control (with childcontrols) and
then adding the result to the form's control collection.

However, in order to maintain viewstate, what would be ideal would be
to actually write the <asp:control id=... runat=server markup of some
controls to this string that I am parsing and adding in the page's
OnInit event.

Does anyone have any idea how to, given an instance of a WebControl,
write the asp.net markup as opposed to the resulting HTML markup?

I hope I have made myself at least slightly intelligible, and thank you
very much in advance.

Tom.

--
tommyw
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Jan 16 '06 #1
0 1071

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

Similar topics

4
1382
by: Ron Vecchi | last post by:
I have a custom control which has a child control (PlaceHolder) The placeholder will have any number of child controls added to it. I would like to catch the rendered content of the placeholder child control prior to it being sent to the browser and wrap all the HTML content in document.write('') JS statements. I'm kind of lost on how to capture the raw HTML content. (for starters :) Any suggestions
2
1898
by: Ronen | last post by:
Hi, I am writing a grid Web control library. The grid has some client side JavaScript to enable columns resize, sorting, row selection etc. I have some problems adding the JavaScript link at the render of the
1
5955
by: Alex Nitulescu | last post by:
Hi. What's the difference between the Render method (overridden when creating custom controls) and the RenderContents method.... (overridden when creating custom controls) ? From MSDN: Render - Sends server control content to a provided HtmlTextWriter object, which writes the content to be rendered on the client.
0
710
by: tommyw | last post by:
I worked out a solution to this incase anyone wants to know. Rather than rendering the asp markup for the control itself, I simply rendered an asp:placeholder tag, parsed the string into a Control, and then added the actual control I wanted to add to the placeholder's control collection. Cheers, T
2
1038
by: MichaelY | last post by:
I am using a treeview control for data display, and am having a bit of a hard time getting the thing styled the way I need it. There appears to be empty rows added in between the tree nodes, causing a (1+1) 2px 'gap'......I noticed in the rendered markup that the height is set to 0px in the style attribute, but it seems to be ignored. I have removed all of my style sheets, emptied cache, start w/blank pages, etc. Testing on IE 6.0 and...
1
1204
by: WT | last post by:
Hello, I recently discovered that Page.Render is doing special things concerning the Menu navigation control. When I was using my own Render override, menus were not working, maybe some style missing, or some javascript not loaded. Any information welcome as I need to do some special work in Render. CS
0
1750
by: Henrik Stidsen | last post by:
I need to get the HTML output from a webcontrol as a string instead of it being rendered on the page. I have the following code: Dim SiteMapSource As New SiteMapDataSource() Dim TreeView1 As New TreeView() TreeView1.DataSource = SiteMapSource TreeView1.ShowExpandCollapse = True
0
2962
by: Jeff | last post by:
hey asp.net 3.5 I have 2 UpdatePanels in my webpage. This webpage has a GridView, which one of its column is a templatefield which again contain a UpdatePanel and a button... The other UpdatePanel is located outside the GridView....
4
2468
by: Ken Fine | last post by:
I've been living with a frustrating issue with VS.NET for some months now and I need to figure out what the problem is. Hopefully someone has run into the same issue and can suggest a fix. I suspect some permissions problem. I'm running VS.NET 2008 in Vista. Symptoms and observations: * ASP.NET's native ImageMap and Image controls work just fine and provide a design-time preview of images that are referenced via the ImageUrl property *...
0
9629
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
9470
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10069
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,...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5370
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5500
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4033
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
3
2865
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.