asp.net - Gridview DataKeyName -


i used code retrieve each row datakey :

    foreach (gridviewrow row in gv.rows)     {         string id = gv.datakeys[row.rowindex].value.tostring();          response.write(id );     } 

but gridview datakeynames in client code?

gridview's datakeys not rendered client side way viewstate rendered client side in hidden field , neither way asp.net scripts added page webresource.axd etc..

you need add key values yourself. why not try encrypting , adding datakeys separately hidden field in markup, in case if that's requirement ( example ). or can add datakeys viewstate too.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -