Re: Can't find other Controls from my own Control
- From: "Benton" <conversar@xxxxxxxxx>
- Date: Mon, 4 Dec 2006 11:31:19 -0600
I'm creating a "PopUpDatePicker" control, inheriting from Hyperlink. The goal is to click on that control, select a value from a Calendar and set this date value to a target control, usually a TextBox.
Adding something to my own question here. I've modified my OnPreRender event to look like this:
protected override void OnPreRender(EventArgs e)
{
Control control = Page.FindControl(TargetControl);
this.Attributes.Add("onclick", string.Format("window.open('DatePicker.aspx?field={0}', 'calendarPopup', 'width=230,height=209,resizable=no,statusbar=no');", control.ClientID));
base.OnPreRender(e);
}
This time I am not casting the current page from the current handler, I'm just using the Page property the Hyperlink control inherited. However, the result is just the same: FindControl() always returns null. What am I doing wrong?
Thanks in advance,
-Benton
.
- Follow-Ups:
- Re: Can't find other Controls from my own Control
- From: Benton
- Re: Can't find other Controls from my own Control
- References:
- Can't find other Controls from my own Control
- From: Benton
- Can't find other Controls from my own Control
- Prev by Date: Can't find other Controls from my own Control
- Next by Date: Re: Can't find other Controls from my own Control
- Previous by thread: Can't find other Controls from my own Control
- Next by thread: Re: Can't find other Controls from my own Control
- Index(es):
Relevant Pages
|
Loading