protected void CreateNewResource_Click(object sender, EventArgs e) { if (this._resource == null) { LabelRecordNotMatch.Text = Resources.Resources.SimilarityMatchResourceSaved; ButtonCreateNew.Visible = false; LabelRecordNotMatch.Visible = true; return; } string typeName = this._resource.GetType().Name; //Add resource to database using (ResourceDataAccess resourceDAL = new ResourceDataAccess()) { resourceDAL.AddResource(this._resource); GrantOwnership(this._resource.Id); } //Do clean up and redirect. Session.Remove(this._guid.ToString("D")); this.ButtonCreateNew.Visible = false; this.PanelResultGrid.Visible = false; errorMessage.Text = string.Format(CultureInfo.CurrentCulture, Resources.Resources.AlertResourceAdded, typeName, Utility.GetLinkTag(Resources.Resources.ManageResourceLink + _resource.Id, Utility.FitString(_resource.Title, 40))); errorMessage.Visible = true; }