2016-06-22 43 views
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); 
} 
+0

'c.country_id = country_id' –

+0

已经尝试过。无论哪个值分配,只需要0 – Rics

+0

只有当您没有在url中提供值时。 –

回答

0

仅使用“id”更改“country_id”。

相关问题