Monday, December 9, 2013

How to add postback trigger to a Gridview Button control?

 protected void gvViewUploadFile_RowCreated(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                LinkButton lnkFile = (LinkButton)e.Row.FindControl("lnkFilePath");
                if (lnkFile != null)
                    ScriptManager.GetCurrent(this.Page).RegisterPostBackControl(lnkFile);
            }
        }

No comments:

 
Feedback Form