0
public ActionResult Edit(int country_id = 0)
{
tbl_country Data = db.tbl_country.Find(country_id);
int a = country_id;
create_tbl_country c = new create_tbl_country();
c.country_name = Data.country_name;
c.country_id = 1; // here taking value of c.country_id=0
return View(c);
}
'c.country_id = country_id' –
已經嘗試過。無論哪個值分配,只需要0 – Rics
只有當您沒有在url中提供值時。 –