protected void btnUpdate_Click(object sender, EventArgs e) { try { country.CountryId = int.Parse(Request["CountryId"].ToString()); country.Name = txtName.Text.Trim(); country.Description = txtDesc.Text.Trim(); country.UpdateCountry(); lblMsg.Text = "Country Updated...!"; } catch (Exception) { throw; } }
public ActionResult Edit(FormCollection formcollection) { CountryBusinessLayer countryBusinessLayer = new CountryBusinessLayer(); Country country = new Country(); country.CountryName = formcollection["CountryName"]; countryBusinessLayer.Id = Convert.ToInt64(Session["EditId"].ToString()); int rv = countryBusinessLayer.UpdateCountry(country); if (rv != 0 && rv != -1) { return(RedirectToAction("Index")); } return(View()); }