I have this label control in my web page
<asp:Label ID='Label1' runat='server' Text='test'></asp:Label>
And when the page rendered the id of the control changes to something like this
<span id='ctl00_ContentPlaceHolder1_Label3'>test</span>
How can I stop asp.net from changing IDs in order to perform a jQuery operation like this
$('#label1').html(xml);
instead of using this selector
use this one, basically you are using the classic asp inline server side code.
this will insert whatever ID that is generated to be placed as a literal.
If you wish to use external files then I would suggest you create an obj that is global on the page to hold all of your client ids and then reference that obj within your external files (not ideal but it is a solution)
and then in your external file you can access Label1 for example:
$('#' + MyClientIDs.Label1)