I set values (of server controls) in an update panel via code-behind, it must be using some javascript method to set those values. if i try to access them through jquery after this, it doesn't recognize anything set by asp.net ajax
asp.net:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Set Label From Ajax" onclick="Button1_Click" />
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
Code behind:
protected void Button1_Click(object sender, EventArgs e)
{
this.Label1.Text = "Hello, world";
}
After the button is clicked and Label1 is "Hello, world" - the following gets the html control correctly, but the text is emtpy:
jQuery:
var text = $("[id$='Label1']").text();
// text = ""; should be "Hello, World"