user clicked on edit or delete button in Grid View need to fire the modal window
You need to inject JavaScript at row level of the grid. You would need to use
RowDataBound
event of grid that triggers on every row bind. In this, inject JS code to open the modalpopup on click of a control.
Sample:
protected void GridView_RowDataBound(Object sender, GridViewRowEventArgs e)
{
DataControlRowType rtype = e.Row.RowType;
if (rtype == DataControlRowType.DataRow)
{
LinkButton l = (LinkButton)e.Row.FindControl("LinkButton1");
l.Attributes.Add("onclick", "javascript: OpenModalDialogMethodDefinedInJS();");
}
}
Refer:
Using JavaScript with ASP.Net GridView Control[
^]