I have a series of Hide/Show LinkButtons dynamically created. Each button corresponds with a GridView. I want to have the OnClick event of the button Hide or Show the GridView. How do I reference the specific corresponding GridView in the HideButtonClick method. I used a counter num to make each LinkButton.ID unique ID="hidebutton" + num
.
LinkButton lbShow = new LinkButton();
lbShow.ID = "lbShow" + num;
lbShow.OnClientClick = "HideCourse_btnClick";
lbShow.CommandArgument = "" + num;
And in the event method I want something to the effect of
protected void HideCourse_btnClick(object sender, EventArgs e)
{
grdvw1.Visible = false
}
where the ID grdwv1 is generated by adding the CommandArgument num to the GridView grdvw