Monday, November 26, 2012

Get Client ID

Hi All,

Please find below simple javascript function to get client Id render by server control in html page via javascript.

function GetClientID(id, context) {

var el = $("#" + id, context);

if (el.length < 1)

el = $("[id$=_" + id + "]", context);

return el;


  var ctrlOk = GetClientID("btnOk").attr("id");

Where "btnOk" is the Id of your server control.

Sachin K.

No comments:

Post a Comment