Hello all,
I am using c#.net
I have different views within my webform, these all generally display different information except for three textboxes (arrival / seen / depart time). To try and cut down on code, I have created a UserControl which contains these three textboxes.
I have referenced the UserControl at the top of my webform and also within each view.
<%@Register TagPrefix="uc1" TagName="userTimes" Src="~/usercontrols/userTimes.ascx"%>
<uc1:userTimes id="userAppointmentTimes" runat="server"></uc2:userTimes>
can’t seem to access the textboxes from the code behind. I need to firstly populate the textboxes and also hold any updated information to be re-inserted back into the database if changed.
Also each textbox has two Validation controls:
- First makes sure it is in time format HH:MM
- Second makes sure the arrival is before the seen time etc
My two questions are:
- How do I access the UserControl from the code behind? I have read that I need to use the FindControl but I don’t understand why, when I know what it is called.
- Do I undertake the validation (server side) within the UserControl code behind or the webform code behind?
Thanks in advance for any help.
Clare