my webpage takes list from customer in the same time i want to display all records from temp_data. PROBLEM is i have to give same id's for table so that i can get the data based on the ID. So please tell something like Ispostback (webforms) in MVC
I WANT TO RETAIN id variable to give same id but it changes on every post. Please help me
{
RMS_DataContext db = new RMS_DataContext();
Order cls_order = new Order();
string id = Guid.NewGuid().ToString();
public ActionResult Index()
{
return View();
}
public ActionResult Create()
{
return View();
}
[HttpPost]
public ActionResult Create(FormCollection form, string btn_orders)
{
switch (btn_orders)
{
case "btn_temp":
Item item = new Item();
var ItemId = form["_OrderId1"];
item = db.Items.FirstOrDefault( x=> x.ItemId==ItemId );
cls_order.Add_Temp(id, item, Convert.ToInt32(form["quantity"].ToString()));
return View();
break;
default:
return View();
}
}
}