protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { MembershipUser CurrentUser = Membership.GetUser(); if (CurrentUser == null) { Response.Redirect("~/Pages/Users/Login.aspx"); } else { Guid userId = (Guid)CurrentUser.ProviderUserKey; DataTable dt = ProjectBLL.GetAllByUserID(userId); gv_Projects.DataSource = dt; gv_Projects.DataKeyNames = new string[] { "ProjectId" }; gv_Projects.DataBind(); ViewState["ProjectDT"] = dt; } } }