jquery in asp.net masterpage
Posted on 2010-08-13
Hi, I am using jquery in an asp.net form with a master page. Initially I could only get the jquery to work in a plain document not using a master page. But looking at the source when the page was running i noticed that where I had put the following source in the content section on the child page:
<input id="btnAnimate" type="button" value="Animate" />
<asp:Panel ID="Panel1" runat="server">
Some sample text in this panel
it had changed the Panel id to
<asp:Panel ID="ctl00_ContentPlaceHolder1_Panel1" runat="server">
so to get this to work I had to rename the object in the header content to reflect this.
My issue is why is this happening. As the ID is being changed dynamically when the page is run, how can I guarantee that the prefix placed will always be ctl00_ContentPlaceHolder1_ as I am not setting this. How does this get set and can I controll this. Also further issues arrise such as when using different browsers.
Many thanks in advance for any advice