Asp.Net MVC Call another controller from view -


Assume I am on the "Home / Index" page and I want to go to page MyOtherController / Index / 1

How can I do this?

I try:

& lt;% = html.ActionLink ("Test", "Index", "MyOtherController", new {id = item.Id} })%>

Do I have to add a path to the Global .aspx file as well?

An option is to specify the name of the controller in the list of root-value:

< Pre> & lt;% = HTML functional ("test", "index", new {controller = "myopter controller", id = item.ID})%>

One option is that the ActionLink ("Test", "Index", "MyOurTransfer", new {ID} :

  & lt;% = html.ActionLink ASP The default route in the Net MVC template takes care of routing in this case. 


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -