Skip to content Skip to sidebar Skip to footer

Hiding/unhiding Control In Gridview's Column Using Javascript

In gridview's column i have a linkbutton and a label under it. I want to hide/unhide label when linkbutton is clicked. I want to use javascript because i don't want any postbacks.

Solution 1:

One way is to manage this in your grid's ItemDataBound event handler and pass the label's ClientID as a string paramater for that JavaScript call.

e.g. myLinkButton.attributes.Add("onclick","javascript:HidColumn('" + myLabel.ClientID + "');");

Post a Comment for "Hiding/unhiding Control In Gridview's Column Using Javascript"