Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
4
Answers
how to get delete and edit id differently in same Action
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Aniruddha Nargund
8y
378
1
Reply
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?
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
asp.net question and asnswer program
Please Help.Question and answer C# .net program.