J
Jaime
Hi all,
I'm going crazy trying to sort out the correct way to find a contol, here's
the scenario:
I have a web form WebForm1 that contains a user control 'UC1'... now the UC1
has another user control called 'CalendarCtl' and the following structure
inside
<asp
anel id="panel1">
<asp:table id="table1">
<asp:tablerow>
<asp:tablecell>
<jdp
opUpCalendar>
<asp:textbox id="date">
<asp:ImageButton id="openCalendarPopUp">
....
now when I click the ImageButton, the calendar control opens fine and works
ok, but on the OnSelectionChanged handler of the CalendarCtl user control, I
can't sort out the correct way to get the instance of the textbox control
with ID="date" in the parent user control...
I've tried:
string boxName; // this contains the ClientID of the TextBox control in UC1
TextBox box = (TextBox) Page.FindControl( boxName ); // nothing... box =
null
HtmlForm form = (TextBox) Page.FindControl( "Form1" );
Panel pnl = (Panel) form.FindControl( "panel1"); // now this one does
not find the panel
Table tbl = (Table) ...
TableRow row = ...
TableCell cell = ...
TextBox box = ...
I can't figure what control to ask for the 'date' TextBox...
Any ideas?
J
I'm going crazy trying to sort out the correct way to find a contol, here's
the scenario:
I have a web form WebForm1 that contains a user control 'UC1'... now the UC1
has another user control called 'CalendarCtl' and the following structure
inside
<asp
<asp:table id="table1">
<asp:tablerow>
<asp:tablecell>
<jdp
<asp:textbox id="date">
<asp:ImageButton id="openCalendarPopUp">
....
now when I click the ImageButton, the calendar control opens fine and works
ok, but on the OnSelectionChanged handler of the CalendarCtl user control, I
can't sort out the correct way to get the instance of the textbox control
with ID="date" in the parent user control...
I've tried:
string boxName; // this contains the ClientID of the TextBox control in UC1
TextBox box = (TextBox) Page.FindControl( boxName ); // nothing... box =
null
HtmlForm form = (TextBox) Page.FindControl( "Form1" );
Panel pnl = (Panel) form.FindControl( "panel1"); // now this one does
not find the panel
Table tbl = (Table) ...
TableRow row = ...
TableCell cell = ...
TextBox box = ...
I can't figure what control to ask for the 'date' TextBox...
Any ideas?
J