0

I am trying to add angularjs in an already build project. I am using angularjs for the index page. I need to call the mvc controller for edit and delete instead of angularjs controller and i need to pass id to the mvc controller. I have used the code.

 <a href="@Url.Action("EditNewsLetter","NewsLetter")/?id = {{item.Id }}">Edit</a> |
 <a href="@Url.Action("DeleteNewsLetter","NewsLetter")/?id = {{item.Id }}">Delete</a>

but it is not passing the values to the controller when i am clicking.

It shows error id cannot be null.I don't have much experience in angular. So please help me to get out of this problem.

Prasad
  • 1,562
  • 5
  • 26
  • 40
Shahzad Ahamad
  • 809
  • 1
  • 11
  • 30

1 Answers1

1

This worked.

<a data-ng-href="@Url.Action("EditNewsLetter","NewsLetter")/{{item.Id}}" target="_self">Edit </a> <a data-ng-href="@Url.Action("DeleteNewsLetter","NewsLetter")/{{item.Id}}" target="_self">Delete </a>
Shahzad Ahamad
  • 809
  • 1
  • 11
  • 30