Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peach 3 posts 23 karma points
    Dec 20, 2011 @ 18:04
    Peach
    0

    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!

  • Peach 3 posts 23 karma points
    Jan 16, 2012 @ 18:14
    Peach
    0

    Anyone has seen anything similar?

Please Sign in or register to post replies

Write your reply to:

Draft