$ get () and $ find () with AJAX.NET

I am trying to follow the example of PageMethods found here .
However, when I try to call, $get('Label1')I get an error message.
Since Label1 is asp: Label, it works if I call $ get () with ClientID. However, the example uses the actual identifier. Is there a way to use $ get () with the actual id?

+3
source share
1 answer

Well, it depends on what the label contains. In some controls, this will be Label1 and it works, in others it will not. Do not take it.

So, on a simple page, it appears as Label1:

   <form id="form1" runat="server">
    <div>
    <asp:Label ID="Label1" Text="test" runat="server"></asp:Label>
    </div>
    </form>

- (ctl00_head_Label1 ), -:

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
 <asp:Label ID="Label1" Text="test" runat="server"></asp:Label>
</asp:Content>
+1

Source: https://habr.com/ru/post/1710272/


All Articles