4
Answers

how to get delete and edit id differently in same Action

i have grid in View like this
 
 
<tr>
<td>@Html.ActionLink("EDIT", "InsertRequest", new { strRequestId = Model.GetAllRequests.Tables[0].Rows[i]["RequestId"].ToString() })</td>
<td>@Html.ActionLink("DELETE", "InsertRequest", new { strRequestId = Model.GetAllRequests.Tables[0].Rows[i]["RequestId"].ToString() })</td>
<td>
@RequestId
</td>
</tr> 
 
now in controller i have actionresult like this
public ActionResult InsertRequest(RequestModel RM, string strRequestId)
{
//if(ModelState.IsValid)
//{
if(strRequestId != "" || strRequestId != null)
{
RM.HubList.Add(new SelectListItem { Value = "BLR", Text = "BLR" });
DataAccessLayer.DBData objDB = new DataAccessLayer.DBData();
string strSelected = Request.Form["strSelectedHub"].ToString();
string strRes = objDB.InsertData(RM);
ViewData["InSertResult"] = strRes;
ModelState.Clear();
return View(RM);
}
}
 
 now i need to get differnetiate between edit and delete and display the same  view .. how i can do it?
 
 
 
 
 
Answers (4)