Re: Can't find other Controls from my own Control



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

.



Relevant Pages

  • Re: Dates in a listbox connected to a form...
    ... Can I tell it somehow exactly where I want the calendar to appear? ... calendar appears, click date, date goes to first textbox. ... "Nikos Yannacopoulos" wrote: ... you would have to use an Intfunction on the control ...
    (microsoft.public.access.forms)
  • Re: Dates in a listbox connected to a form...
    ... I take it you mean position the calendar form on the screen? ... Private Sub ActiveXCtl1_Click ... first textbox, because the calendar's click event didn't have the extra line ... the calendar control has no time ...
    (microsoft.public.access.forms)
  • Re: Calendar code not working
    ... the workbook or worksheet being protected (you also checked the workbook, ... and Insert controls, in the ActiveX controls I have listed "Calendar Control ... I do have the mscal.ocx file on my office computer. ...
    (microsoft.public.excel.misc)
  • Re: Calendar code not working
    ... I chose to "Repair" the installation and the Calendar control now works ... I presume it's hidden within the sheet somehow and you need ... I do have the mscal.ocx file on my office computer. ...
    (microsoft.public.excel.misc)
  • RE: Actual Date
    ... control is populated programmatically as it is in this case. ... The only thing wrong with that is that now the calendar ... Private Sub cmdMonthDown_Click ... Select Case KeyCode ...
    (microsoft.public.access.gettingstarted)

Loading