Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > General Discussions > ClientIdMode support for ASP.NET 4.0

Not answered ClientIdMode support for ASP.NET 4.0

Feed from this thread
  • Posted on May 17, 2010 (permalink)

    A new feature implemented in ASP.NET 4.0 is the possibility to control the way that controls’ ClientID is generated. At present, RadControls for ASP.NET AJAX expect the ClientID’s of their child controls to be generated by the default method (AutoID). Because of that, if ClientIDMode is set to different method of generation you can experience various problems with RadControls, for example not working dialogs for RadEditor.

    Here are some of the errors that you could experience when the ClientIDMode is set to Static:

    All RadControls: Invalid JSON primitive:..
    RadEditor's dialogs : Error: 'null' is null or not an object
    RadEditor's dialogs : Sys.ArgumentNullException: Dialog Parameters for the FindAndReplace dialog do not exist  Parameter name: dialogueName.
    RadFileExplorer: might not display the files in the folder
    RadGrid : calling get_masterTableView() returns null
    "Microsoft JScript runtime error: 'get_postBackElement().id' is null or not an object"

    This problem is already added to our TODO list and it should be fixed for RadControls for ASP.NET AJAX Q2 2010. For the time being, we recommend to use ClientIDMode="AutoID" or if you have to use different method you should set the ClientIDMode property’s value explicitly to AutoID to the specific RadControl.

    Additional information regarding this new .NET4.0 feature is available in the following article:
    ASP.NET 4.0 ClientID Overview

    Please note that Microsoft does not recommend setting ClientIDMode="Static" on pages which do contain dynamic controls.

    Best regards,
    The Telerik team

    Reply

  • Mike avatar

    Posted on Jul 20, 2010 (permalink)

    Hello,
    I've installed the Q2 2010 version however it does not appear that ClientIDMode is being implemented as expected by the Telerik controls. I have set ClientIDMode to both static and predictable, yet the tabs and text boxes being displayed are still rendered with ctl0_ctl0 prefixes. Would it be possible to get a clarifying statement with examples of the extent to which ClientIDMode is supported and what names will be generated? I've searched through the forum posts and read the release notes for Q2 2010 and its not very clear what or if is supported. From the release notes:

    "Improved: Updated the RadControls which are naming containers to use the AutoID ASP.NET 4 ClientIdMode. Solves compatibility problems when mode is set globaly to Static"

    Maybe I am misunderstanding, however it sounds to me like what that means is that the Telerik controls, or at least some of them which are not specified, will implement auto IDs, and by extension this will be implemented on their child controls, regardless of the mode set by the programmer using the controls.

    I think however its setup its something we can work with if we can just get an understanding of how this is supposed to work so we don't lose time coding solutions only to find they are not compatible with an imprecise or misunderstood naming system.

    Thank you!

    Reply

  • nick avatar

    Posted on Jul 21, 2010 (permalink)

    It appears that Telerik is forcing their controls to use AutoID.  This is not the way MicroSoft intended controls to work, based on their documentation for the ClientIdMode property:

    http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientidmode.aspx

    I truly believe that Telerik needs to rethink their implementation.  Otherwise they are completely removing the flexibility Microsoft introduced with this setting.

    Reply

  • Tsvetomir Tsonev Tsvetomir Tsonev admin's avatar

    Posted on Jul 23, 2010 (permalink)

    Hi,

    I'm copying the reply to Nick's bug report here for community reference:


    Our motivation for forcing AutoID over Inherit is that neither Static nor Inherit work reliably when it comes to controls with complex hierarchies of child controls and templates. We've chosen to play it safe and keep the old behavior until we were certain that we can reliably support this new feature.

    I agree that not being able to set the ClientIdMode explicitly is a bit excessive. We've logged this and we'll fix it for the SP1 release.

    In the extreme case you can inherit any of the RadControls and override the ClientIDMode property.

    Apologies for the caused inconvenience.


    Sincerely yours,
    Tsvetomir Tsonev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Matt Smith avatar

    Posted on Aug 12, 2010 (permalink)

    I would also say that forcing the AutoID will break current applications which are using your current behaviour.

    I don't know which the worse of the two evils.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > General Discussions > ClientIdMode support for ASP.NET 4.0