Custom .Net User Controls Changing ID - Caching related
Hi folks, new to the forum, hope this is the correct place to post.
I'm having a problem with a custom .NET control in that on page reload, the control ids are changing. The control is a simple textbox and button which submits the form. The control then handles the postback. On first page load I'm seeing the textbox's ID as 'ctl00$ctl00$ctl00$ContentPlaceHolderDefault$mainContent$Item7$NewsletterSignup_8$txtEmail_Newsletter'
however on relod (F5) or a postback, the textbox changes id to 'ctl00$ctl00$ctl00$ContentPlaceHolderDefault$mainContent$Item7$NewsletterSignup_9$txtEmail_Newsletter'
I've tried setting the ClientIDMode property to 'static' but this has no effect.
On further investigation I have narrowed the problem down to what seems to related to other macros on the page which have a cache period set, if I rest all these to 0 seconds, then the control does not change ID, however if any or all are set to use a cache period, then the ID changes.
At least I have narrowed the problem down, however it would be nice if I could reinstate caching.
Any help is greatly appreciated, thanks in advance!
Custom .Net User Controls Changing ID - Caching related
Hi folks, new to the forum, hope this is the correct place to post.
I'm having a problem with a custom .NET control in that on page reload, the control ids are changing.
The control is a simple textbox and button which submits the form. The control then handles the postback. On first page load I'm seeing the textbox's ID as 'ctl00$ctl00$ctl00$ContentPlaceHolderDefault$mainContent$Item7$NewsletterSignup_8$txtEmail_Newsletter'
however on relod (F5) or a postback, the textbox changes id to 'ctl00$ctl00$ctl00$ContentPlaceHolderDefault$mainContent$Item7$NewsletterSignup_9$txtEmail_Newsletter'
I've tried setting the ClientIDMode property to 'static' but this has no effect.
On further investigation I have narrowed the problem down to what seems to related to other macros on the page which have a cache period set, if I rest all these to 0 seconds, then the control does not change ID, however if any or all are set to use a cache period, then the ID changes.
At least I have narrowed the problem down, however it would be nice if I could reinstate caching.
Any help is greatly appreciated, thanks in advance!
Anyone has seen anything similar?
is working on a reply...