protected void frmCityMaster_ItemCommand(object sender, FormViewCommandEventArgs e) { TextBox txtCityCode = (TextBox)frmCityMaster.FindControl("txtCityCode"); TextBox txtStateCode = (TextBox)frmCityMaster.FindControl("txtStateCode"); TextBox txtCityName = (TextBox)frmCityMaster.FindControl("txtCityName"); TextBox txtKey = (TextBox)frmCityMaster.FindControl("txtKey"); TextBox txtRank = (TextBox)frmCityMaster.FindControl("txtRank"); TextBox txtPriority = (TextBox)frmCityMaster.FindControl("txtPriority"); DropDownList ddlState = (DropDownList)frmCityMaster.FindControl("ddlState"); dvMsgCity.Visible = true; if (Convert.ToString(e.CommandName) == "UpdateCityManager") { MDMSVC.DC_City _obj = new MDMSVC.DC_City(); _obj.City_Id = Guid.Parse(Request.QueryString["City_Id"]); _obj.Country_Id = refCountryId; _obj.Name = txtCityName.Text; _obj.Code = txtCityCode.Text; _obj.Key = txtKey.Text; _obj.Rank = txtRank.Text; _obj.Priority = txtPriority.Text; _obj.State_Id = Guid.Parse(ddlState.SelectedValue); _obj.StateName = ddlState.SelectedItem.Text; _obj.StateCode = txtStateCode.Text; _obj.Edit_Date = DateTime.Now; _obj.Edit_User = System.Web.HttpContext.Current.User.Identity.Name; MDMSVC.DC_Message _msg = new MDMSVC.DC_Message(); _msg = _objMasterData.UpdateCityMasterData(_obj); if (_msg.StatusCode == MDMSVC.ReadOnlyMessageStatusCode.Success) { BootstrapAlert.BootstrapAlertMessage(dvMsgCity, "City has been updated successfully", BootstrapAlertType.Success); } else { BootstrapAlert.BootstrapAlertMessage(dvMsgCity, _msg.StatusMessage, (BootstrapAlertType)_msg.StatusCode); } } }