I have created on MVC application. In that I have added 3 anchor tags.On click of each anchor tag I want to call function from control within same view only. How can I do this?Please find below code
Code for Index.cshtml file
@{
string actionname = (here I want to pass action values i.e which anchor tag is clicked on basis of this pass action name i.e Create/Edit/Delete);
}
@using (Html.BeginForm("Edit", "Home", FormMethod.Post, new { id = "submitForm" }))
{
New
Edit
Delete
}
In Controller class I have written following code
[HttpPost]
public ActionResult Create()
{
return RedirectToAction("Index");
}
[HttpPost]
public ActionResult Edit()
{
return RedirectToAction("Index");
}
[HttpPost]
public ActionResult Delete()
{
return RedirectToAction("Index");
}
Now how can I get which anchor tag is clicked. So according to that I will dynamically pass action name in Html.Beginform(. Please help me in this.