I have a composite user quote control down, which consists of a text field and a calendar, as well as a validation control. I set a property called "TextBox" in the usercontrol that returns a link to the text field used in the control. This is a text field in which the user enters a date.
On an ASPX page, I have an instance of this usercontrol:
<uc1:DropDownCalendar ID="dtmDateFirstEntry" runat="server" Required="True" />
In my code behind, I want to determine when the user has a tab from a text field and, using the UpdatePanel, abstracts the corresponding message depending on the specified date.
Elsewhere in the ASPX page, I have the following:
<asp:UpdatePanel ID="upIntendedStay" runat="server">
<ContentTemplate>
<asp:Label ID="Label4" runat="server" Text="Update this text from server" CssClass="ErrorText"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
Here is what I am doing in the code behind:
If Not Me.IsPostBack Then
dtmDateFirstEntry.TextBox.AutoPostBack = True
Dim trigger As New AsyncPostBackTrigger
trigger.ControlID = dtmDateFirstEntry.TextBox.ClientID
trigger.EventName = "onChange"
upIntendedStay.Triggers.Add(trigger)
End If
, , - :
<input id="ctl00_phPageContent_dtmDateFirstEntry_txtDate" class="DefaultTextBox" name="ctl00$phPageContent$dtmDateFirstEntry$txtDate" onchange="javascript:setTimeout('__doPostBack(\'ctl00$phPageContent$dtmDateFirstEntry$txtDate\',\'\')', 0)" onkeypress="if (WebForm_TextBoxKeyHandler(event) == false) return false;" style="width: 112px;" type="text" value="Mar-29-2010" />
<input id="ctl00_phPageContent_dtmDateFirstEntry_imgDate" name="ctl00$phPageContent$dtmDateFirstEntry$imgDate" src="images/calendar.JPG" style="border-width: 0px;" type="image" />
, :
A control with ID 'ctl00_phPageContent_dtmDateFirstEntry_txtDate' could not be found for the trigger in UpdatePanel 'upIntendedStay'.
, UpdatePanel. , .
, usercontrol . , , , , UpdatePanel.
, Textbox, textbox1 :
<asp:UpdatePanel ID="upIntendedStay" runat="server">
<ContentTemplate>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Label ID="Label4" runat="server" Text="Update tHis text from server" CssClass="ErrorText"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
:
'onchange' 'TextBox1' UpdatePanel 'upIntendedStay'.
, TEXTBOX1 UpdatePanel, "ClientId" "ID" "OnChange" "TextChanged", . , UpdatePanel.
? .
Dim trigger As New AsyncPostBackTrigger
'trigger.ControlID = dtmDateFirstEntry.TextBox.ID '<<<<<<<<<<<<<<<<<<<<<
trigger.ControlID = TextBox1.ID
trigger.EventName = "TextChanged"
upIntendedStay.Triggers.Add(trigger)
.. "", :
'txtDate' UpdatePanel 'upIntendedStay'.
. -, , , , , usercontrol!