473,406 Members | 2,707 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,406 software developers and data experts.

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(object sender, System.EventArgs e)
{
StringWriter String_Writer=new StringWriter();
HtmlTextWriter Html_Writer=new HtmlTextWriter(String_Writer);
Main_Div.RenderControl(Html_Writer);
Response.Write(String_Writer);
Response.End();
}

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

Best Regards,
Nigil Chua

"Nigil" <nc***@mfglobal.com.sgwrote in message
news:uQ**************@TK2MSFTNGP06.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(object sender, System.EventArgs e)
{
StringWriter String_Writer=new StringWriter();
HtmlTextWriter Html_Writer=new HtmlTextWriter(String_Writer);
Main_Div.RenderControl(Html_Writer);
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(object sender, System.EventArgs e)
{
StringWriter String_Writer=new StringWriter();
HtmlTextWriter Html_Writer=new HtmlTextWriter(String_Writer);
Main_Div.RenderControl(Html_Writer);
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
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...
0
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...
0
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...
1
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...
1
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...
1
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...
5
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 =...
2
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...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
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.