troubleshooting Question

MVC: Sending an ID from a view to a controller and doing something with it

Avatar of Member_2_1242703
Member_2_1242703 asked on
.NET MVCWeb DevelopmentC#
7 Comments1 Solution311 ViewsLast Modified:
I have a button on a view located at: localhost:99998/MyController/Edit/5017

 <input type="button" value="Delete" class="btn btn-danger" onclick="location.href='@Url.Action("DelRec", "MyController")'" />

I want to take the ID (in this case 5017)
send it to the controller action (DelRec)
then update the correlating record (5017)

How do I do this?
ASKER CERTIFIED SOLUTION
Member_2_1242703

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros