when i click on update using edit button in gridview. usercontrol is not getting popup here is my code.
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="GridUser.aspx.cs" Inherits="aspprojects2.Gridview.GridUser" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/usercontrol/LocationUser.ascx" TagName="usercontrol" TagPrefix="uc1"%>



 

 
 
 
 
 
 
 

 

 
 
  <%# Eval("regionalgroup") %>
 

 
 
 

 

 
 
 
 

 

 

 


 
 

    TargetControlID="lnkfake" BackgroundCssClass="modalBackground"
  DropShadow="false">
 

   
 

 
 
   
 



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
using BO;

namespace aspprojects2.Gridview
{
  public partial class GridUser : System.Web.UI.Page
  {
  Employees emp = new Employees();
  protected void Page_Load(object sender, EventArgs e)
  {
  if (!IsPostBack)
  FillLocations();
  }

  protected void FillLocations()
  {
  gv.DataSource = emp.GetLocations();
  gv.DataBind();
  }

  protected void Edit(object sender, EventArgs e)
  {
  LinkButton lnk = sender as LinkButton;
  GridViewRow row = (GridViewRow)lnk.NamingContainer;
  uc.locationid = Convert.ToInt32( gv.DataKeys[row.RowIndex].Value.ToString());
  uc.regionalgroup = row.Cells[1].ToString();
  ModalPopupExtender1.Show();
  }
  }
}
.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LocationUser.ascx.cs" Inherits="aspprojects2.LocationUser" %>




 
 
 
 
 
 
 
 
 
 
 
 


 
 

 
 

 
 

 
 

 
 

 
 





.ascx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
using BO;

namespace aspprojects2
{
  public partial class LocationUser : System.Web.UI.UserControl
  {

  private int _locatonid = 0;
  private string _regionalgroup = string.Empty;

  #region properties
  public int locationid
  {
  get { return _locatonid; }
  set { _locatonid = value; }
  }

  public string regionalgroup
  {
  get { return _regionalgroup; }
  set { _regionalgroup = value; }
  }
  #endregion properties

  Employees emp = new Employees();
  Location lo = new Location();
  protected void Page_Load(object sender, EventArgs e)
  {
  if (!IsPostBack)
  txtlocationid.Text = locationid.ToString();
  txtregionalgroup.Text = regionalgroup;
  }

  protected void btnsave_Click(object sender, EventArgs e)
  {
  lo.locationid = Convert.ToInt32(txtlocationid.Text);
  lo.regionalgroup = txtregionalgroup.Text;
  emp.updatelocation(lo);
  }
  }
}
i am getting error like this.
Microsoft JScript runtime error: 'this._foregroundElement.parentNode' is null or not an object