Id values changing

Topics: General, Troubleshooting, XSLT
Jul 15, 2011 at 4:26 PM
Edited Jul 15, 2011 at 4:28 PM


So I have a function that has a couple of div tags with ids. When I preview the function, everything works perfectly. But when I call the function inside a masterpage, suddenly "ct100_" is prefixed to all of my id attributes. This obviously completely messes with all my styling. The real odd thing is that when I call the function inside of a page's content (using Insert>Function on the visual editor), there is no problem! I created a completely new function with nothing but one div tag and text, but it still has the problem. This happens regardless of the masterpage.

I could work around this, but I am probably just messing something simple up.



Jul 15, 2011 at 4:33 PM


Check your Masterpage and make sure that <%@ Master %>  top element has ClientIDMode="Static" attribute.


<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Common.master.cs" Inherits="Common"
	ClientIDMode="Static" %>



Jul 15, 2011 at 4:40 PM

Thank you so much!

That fixed it.

Jul 15, 2011 at 4:49 PM

I generally recommend setting this in web.config on the pages section so its globally effective... disabling viewstate as well since its usually just cluttering everything up and you can just enable it on control-basis if its needed


      <pages clientIDMode="Static" enableViewState="false" controlRenderingCompatibilityVersion="4.0" />