Rendering composite control...

J

Jeti [work]

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...
 
D

Dan Bass

is it a case that it renders, but the links do not work?
have you turned on the autopostback property on your control?
 
J

Jeti [work]

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...
 
J

Jeti [work]

I solved my problem... forgot to put following line:

this.Controls.Add (ctrl_instance);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top