473,802 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RenderControl with Sub Controls.

Hi Guys,

Does anyone know how to RenderControl with sub controls? cos I am having
issues with that.
Following is my code.

Inside my UserControls, I have a Repeater.

<form method="post" class="Form1" runat="server" id="Form1">
<div id="Main_Div" runat="server">
<Test:Ctr id="Test" runat="server"> </Test:Ctr>
</div>
</form>

So when I call the RenderControl on my "Main_Div", it does not render the
Repeater.

private void Page_Load(objec t sender, System.EventArg s e)
{
StringWriter String_Writer=n ew StringWriter();
HtmlTextWriter Html_Writer=new HtmlTextWriter( String_Writer);
Main_Div.Render Control(Html_Wr iter);
Response.Write( String_Writer);
Response.End();
}

Best Regards,
Nigil Chua
Jan 14 '08 #1
2 3585
FYI, I have still using Framework 1.1

Best Regards,
Nigil Chua

"Nigil" <nc***@mfglobal .com.sgwrote in message
news:uQ******** ******@TK2MSFTN GP06.phx.gbl...
Hi Guys,

Does anyone know how to RenderControl with sub controls? cos I am having
issues with that.
Following is my code.

Inside my UserControls, I have a Repeater.

<form method="post" class="Form1" runat="server" id="Form1">
<div id="Main_Div" runat="server">
<Test:Ctr id="Test" runat="server"> </Test:Ctr>
</div>
</form>

So when I call the RenderControl on my "Main_Div", it does not render the
Repeater.

private void Page_Load(objec t sender, System.EventArg s e)
{
StringWriter String_Writer=n ew StringWriter();
HtmlTextWriter Html_Writer=new HtmlTextWriter( String_Writer);
Main_Div.Render Control(Html_Wr iter);
Response.Write( String_Writer);
Response.End();
}

Best Regards,
Nigil Chua

Jan 14 '08 #2
as you are short-circuiting the page processing events, the repeater is
probably never bound to anything.

-- bruce (sqlwork.com)
"Nigil" wrote:
Hi Guys,

Does anyone know how to RenderControl with sub controls? cos I am having
issues with that.
Following is my code.

Inside my UserControls, I have a Repeater.

<form method="post" class="Form1" runat="server" id="Form1">
<div id="Main_Div" runat="server">
<Test:Ctr id="Test" runat="server"> </Test:Ctr>
</div>
</form>

So when I call the RenderControl on my "Main_Div", it does not render the
Repeater.

private void Page_Load(objec t sender, System.EventArg s e)
{
StringWriter String_Writer=n ew StringWriter();
HtmlTextWriter Html_Writer=new HtmlTextWriter( String_Writer);
Main_Div.Render Control(Html_Wr iter);
Response.Write( String_Writer);
Response.End();
}

Best Regards,
Nigil Chua
Jan 14 '08 #3

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

Similar topics

2
9632
by: George Ter-Saakov | last post by:
I am trying to wrap PlaceHolder so it will output prefix/suffix (like <div>, </div>) before render the actual control. So i created public class clsSection : PlaceHolder protected override void Render(HtmlTextWriter writer) {
0
1039
by: charles | last post by:
I can use RenderControl to a stream with HtmlControls and it works like a champ to produce the Html Text for the controls. When I try the same thing on a Web User Control I get nada. ...and the important Page_Load and PreRender events which would make the control work properly are never called. Anybody know if this is this by design or am I missing something? thanks
0
1084
by: zoneboy | last post by:
I'm doing a somewhat complex page with client side postbacks, and I'm rendering a control with a TreeView on it in code. What I've found is that if I embed the control directly and populate the whole tree, then expand/collapse is done client side with javascript. If I use RenderControl, the expand button want's to do a postback, and sniffing the html which is received by the page I see that child nodes are not included (unless expanded...
1
2710
by: John Dalberg | last post by:
I am trying to send a webpage with datagrids as an email so I use the code snippet below. In one of my datagrids, I reformat some rows in the datagrid's Prerender event. The code behind of the page displays the page and sends the email. The page displays fine however the email has the same look and everything *except* the changes that were made in the grid's prerender. I think I am missing something and was wondering why the changes were...
1
3523
by: GroupReader | last post by:
When doing a "callback" I normally call a webControl's RenderControl method to get the html for that WebControl. This has always worked great in the past, but it does not seem to work with an asp:treeview control. When I call MyTreeView.RenderControl, the html that I get is not what I expected - it's as if all of the styles and properties that I set on the treeview are not there. Is this a bug in the treeview control?
1
2406
by: GroupReader | last post by:
When doing a "callback" I normally call a webControl's RenderControl method to get the html for that WebControl. This has always worked great in the past, but it does not seem to work with an asp:treeview control. When I call MyTreeView.RenderControl, the html that I get is not what I expected - it's as if all of the styles and properties that I set on the treeview are not there. Is this a bug in the treeview
5
3188
by: rajdevramasamy | last post by:
Hi, In my webpage, i am adding my user control using rendercontrol() using the following code: Dim NumericEditControl As New Control NumericEditControl = LoadControl("Controls\NumericEdit.ascx") Dim sb As New StringBuilder() Dim sw As New StringWriter(sb) Dim htw As New HtmlTextWriter(sw)
2
5324
by: Josh Carver | last post by:
Hi group, I'm trying to get the outputted html from some specific controls on a page, and I'm finding that some controls will render fine, while others will throw the error that " must be placed inside a form tag with runat=server." For example, a label control will render fine, but a button will not. It seems that any control that has a server-side click event will not accept being rendered in this way. Does anyone know what I can do...
0
1138
by: wagswvu | last post by:
I am writing a User Control in C# that dynamically generates some text boxes and two buttons. For all the html on the page I am overriding the render method, I also render my Button/Textbox controls as well using the “.RenderControl”. However, when I do that I can’t seem to get my button click events to work. protected void LoadSearchButtons(HtmlTextWriter htmlWriter) { searchButton = new Button(); ...
0
9699
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
9562
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
10305
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...
0
10063
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
9115
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7598
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
6838
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();...
1
4270
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
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.