Accessing DataKeyName from Client Side

2 posts, 0 answers
  1. David Sanderson
    David Sanderson avatar
    4 posts
    Member since:
    Nov 2005

    Posted 15 Nov 2015 Link to this post

    Please advise whether it is possible to get a DataKeyName value for the current DataForm page client side?
  2. Eyup
    Eyup avatar
    3296 posts

    Posted 18 Nov 2015 Link to this post

    Hi David,

    You can achieve this requirement by placing a HiddenField within the active template of the DataForm and set its Value property as the Eval expression for the desired DataKey field:

    Then, you can access the HiddenField value on client-side using the findControl() approach demonstrated in the attached web site sample.

    Hope this helps. Please give it a try and let me know if it works for you.

Back to Top