protected void lnbtnNewMsgView_Click(object sender, EventArgs e) { LinkButton btndetails = sender as LinkButton; GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer; string sID = gvCustomerMessage.DataKeys[gvrow.RowIndex].Value.ToString(); ServeAtDoorstepService objService = new ServeAtDoorstepService(); DataTable dtMsg = objService.SelectCusMessageById(Convert.ToInt32(sID)); if (dtMsg.Rows.Count > 0) { hdnCategoryId.Value = dtMsg.Rows[0]["CategoryId"].ToString(); hdnCustomerId.Value = dtMsg.Rows[0]["CustomerId"].ToString(); hdnQuoteId.Value = dtMsg.Rows[0]["QuiryId"].ToString(); hdnVendorId.Value = dtMsg.Rows[0]["VendorID"].ToString(); txtReplySubject.Text = "Re: " + dtMsg.Rows[0]["MessageTitle"].ToString(); lblSubject.Text = dtMsg.Rows[0]["MessageTitle"].ToString(); lblDescription.Text = dtMsg.Rows[0]["Description"].ToString(); lblCreatedOn.Text = dtMsg.Rows[0]["CreatedOn"].ToString(); lblVendor.Text = dtMsg.Rows[0]["VendorName"].ToString(); lblCategory.Text = dtMsg.Rows[0]["CategoryName"].ToString(); } this.ModalPopupReply.Show(); }