If and only if you do not plan to build the container and you need to place JavaSctipt / jQuery in an external file, you can use the generated identifiers in your jQuery selectors, i.e.
$('#ctl00_ContentPlaceHolder1_Label3').html(xml);
Obviously, this approach requires you to know what generated identifiers will be, and requires caution if you ever begin to change the structure of the site / application.
Otherwise your best options
1. Use inline code markup on the server side. The disadvantage of this approach is that you cannot put your js code in an external file -
$('#<%= Label3.ClientID %>').html(xml);
2. Define unique CSS classes for each control that you want to use in your jQuery, which will still allow you to put your js code in an external file -
<asp:Label ID="Label3" runat="server" Text="test" CssClass="label3"> </asp:Label> $('.label3').html(xml);
3. Use the jQuery selector to match the source identifier, which will also allow you to put your js code in an external file -
$('[id$=Label3]').html(xml);
This jQuery selector will select all elements with id whose value ends with Label3. The only potential drawback I could see with this approach is that it is theoretically possible to have a Label control with Label3 identifier, for example, a main page, as well as two content pages. In this example, using the jQuery selector above would match all three shortcuts that could have undesirable effects.
EDIT:
I thought it would be useful to draw your attention to IDOverride control . A sample page can be found here.
It allows you to specify which controls should have their garbled identifier in the output HTML markup, overridden by the identifier, as indicated in the .aspx file when rendering the HTML page. I only played with him briefly with one main page and panels, but it seems to work well. Using this, you can use the original identifiers in your jQuery selectors. However, keep in mind that the results are unpredictable if you must have controls with the same identifiers on the main page (s) and content page, which are combined to display HTML for one page.