473,396 Members | 1,921 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,396 software developers and data experts.

Rendering composite control...

I have made simple control which contains one Calendar control. The problem
is that the Calendar control does not behave correctly (doesn't have
hyperlinks) when my control renders... here's some of the code:

public class MyControl
{
private Calendar _calendar;

protected override void CreateChildControls()

{

_calendar = new Calendar();

_calendar.SelectedDate = DateTime.Now;

_base.CreateChildControls ();

}

protected override void OnPreRender(EventArgs e)

{

if (Page.Request["step"] == "3")

this.EnsureChildControls();

base.OnPreRender (e);

}

protected override void Render(HtmlTextWriter output)

{

_calendar.RenderControl (output);

}
}

i tried to inherit INamingContainer - didnt work.
How to make calendar work?

thank you...
Nov 18 '05 #1
3 1077
is it a case that it renders, but the links do not work?
have you turned on the autopostback property on your control?

"Jeti [work]" <je**@programeri.org> wrote in message
news:eV**************@TK2MSFTNGP10.phx.gbl...
I have made simple control which contains one Calendar control. The problem
is that the Calendar control does not behave correctly (doesn't have
hyperlinks) when my control renders... here's some of the code:

public class MyControl
{
private Calendar _calendar;

protected override void CreateChildControls()

{

_calendar = new Calendar();

_calendar.SelectedDate = DateTime.Now;

_base.CreateChildControls ();

}

protected override void OnPreRender(EventArgs e)

{

if (Page.Request["step"] == "3")

this.EnsureChildControls();

base.OnPreRender (e);

}

protected override void Render(HtmlTextWriter output)

{

_calendar.RenderControl (output);

}
}

i tried to inherit INamingContainer - didnt work.
How to make calendar work?

thank you...

Nov 18 '05 #2
> is it a case that it renders, but the links do not work?
have you turned on the autopostback property on your control?


Yes, it renders fine, but the links dont work... My control doesnt have
"AutoPostback" property...
i'm inheriting WebControl... is that ok?
public class MyControl : WebControl
{
...
}


thank you...
Nov 18 '05 #3
I solved my problem... forgot to put following line:

this.Controls.Add (ctrl_instance);
Nov 18 '05 #4

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

Similar topics

0
by: Satya Bojanapally | last post by:
Hi, I am unable to add a pager for this composite control. I had created a composite control in C#. The control is having 5 labels, one radio button and one DropDownList control. The composite...
1
by: Paul Kia | last post by:
I have an ATL composite control which I drop into a tab control dialog page of an MFC application. When I click on the composite control and then click anywhere outside the MFC application, the...
0
by: Steve R | last post by:
I've built a composite web custom control with a lot of child controls. I assigned ToolTip values to some of these controls. The ToolTip pop-ups were working fine until I monkeyed with the order...
5
by: Barry Carr | last post by:
Hi, I've created a composite custom web control and a ControlDesigner descendant to render the control a design time. The child controls are public properties of composite control and as such...
1
by: sleigh | last post by:
Hello, I'm building a web application that will build a dynamic form based upon questions in a database. This form will have several different sections that consist of a panel containing one to...
3
by: Beavis | last post by:
I hate to repost a message, but I am still at the same point where I was when I originally posted, and hopefully someone else will see this one... Ok, so I have gone off and documented the...
5
by: paul.hester | last post by:
Hi all, I have a custom control with an overridden Render method. Inside this method I'm rendering each control in its collection using their RenderControl method. However, I'm running into a...
2
by: Chris | last post by:
I have created a custom composite control, which is a date picker. It works fine but in the design view I get am "Error creating control" 'caltext' could not be set on property 'btnCssClass' ...
3
by: Eric | last post by:
I have created a fairly basic composite control consisting of a Label and a TextBox. In the overridden Render function, I'm creating a table with two rows and each row contains a cell (td). The...
6
by: shapper | last post by:
Hello, I am working in a class library with various custom controls. In which cases should a control inherit Control, WebControl and CompositeControl classes? And when should a custom...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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...
0
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...
0
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...

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.