ASP.NET - popup window open when clcik gridview editbutton and corresponding value pass to that page

Asked By msakt on 18-Jun-12 03:33 AM
popup window open when clcik gridview editbutton and corresponding value pass to that page
TSN ... replied to msakt on 18-Jun-12 07:41 AM

Hi

You can use the help of RowEditing Event in the gridview and using javascript window .open perform the opening of new page and pass the edit index item as Query string and based on Query string perform the required task  .

//Code to be performed

protected void GridView_RowEditing(object sender, GridViewEditEventArgs e)

{

    try

    {

     

  string BrowserSettings = "status=no,toolbar=no,menubar=no,location=no,resizable=no, titlebar=no,addressbar=no, width=600 ,height=750";

  string URL = "http://localhost/NewPage.aspx?" + e.NewEditIndex;

  string scriptText = "window.open('" + URL + "','_blank','" + BrowserSettings + "');";

  ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "ClientScript1", , scriptText, true)

  }

}