ClientIdMode support for ASP.NET 4.0

11 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 17 May 2010 Link to this post

    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

  2. Mike
    Mike avatar
    11 posts
    Member since:
    Jul 2010

    Posted 20 Jul 2010 Link to this post

    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!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. nick
    nick avatar
    11 posts
    Member since:
    Apr 2007

    Posted 21 Jul 2010 Link to this post

    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.
  5. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 23 Jul 2010 Link to this post

    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
  6. Matt Smith
    Matt Smith avatar
    17 posts
    Member since:
    Dec 2005

    Posted 12 Aug 2010 Link to this post

    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.
  7. David Rhodes
    David Rhodes avatar
    60 posts
    Member since:
    May 2005

    Posted 27 Mar 2013 Link to this post

    Hi,

    Was this ever fixed, i'm using RadAjaxManagerProxy in the 2013 controls and they only work for clientIDMode="AutoID", not Static
  8. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 01 Apr 2013 Link to this post

    Hello David,

    Please note that using Static ID mode for Rad Controls is not supported. You should use AutoID mode for the RadControls on the page especially when they are performing ajax requests..
    Microsoft recommends using ClientIDMode=Static only for static control. RadControls on the other hand are controls with complex hierarchies of child controls and templates so setting their ClientID mode to static will break their functionality.

    Kind regards,
    Maria Ilieva
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  9. Kin
    Kin avatar
    12 posts
    Member since:
    Aug 2013

    Posted 16 Jun 2015 in reply to Maria Ilieva Link to this post

    Hi Maria,

    is there possibility to set ClientIdMode to "Predictable" for all Telerik controls in project?

  10. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 19 Jun 2015 Link to this post

    Hi Kin,

    It is not possible to modify the ClientIDMode for only the Telerik controls on the page. You can globally set the ClietIDMode int he Page directive which will modify the mode for all the controls on the page.

    Regards,
    Maria Ilieva
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  11. Kin
    Kin avatar
    12 posts
    Member since:
    Aug 2013

    Posted 23 Jun 2015 in reply to Maria Ilieva Link to this post

    If I set ClientIdMode globally on page level for example, then all controls except Telerik changes it modes,
    but Telerik still uses it's own ClientIDMode :)
    It some surprising me. Is it defect?

  12. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 25 Jun 2015 Link to this post

    Hi,

    Find attached a small test application where the ID mode is correctly set. Test it on your end and verify what the difference in your  case is.

    Regards,
    Maria Ilieva
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017