In the past, when I used Asp.net MVC to do things, "*/? Length =. At that time, there was no good solution, and it was solved through static links. Of course, there were also many problems. The statement is <% = html. actionlink ("default", "Index", "default", new {id = 1}) %>. Previously, the technology was intolerable. How can this happen now. Decisive Google, "Asp.net MVC length = 5", the first is.
Link: Workshop. The problem is similar to mine. The solution is to add a null value after the actionlink parameter. Why?
original HTML. the overload of actionlink ("default", "Index", "default", new {id = 1}) is as follows:
Public static mvchtmlstring actionlink (this htmlhelper, string linktext, string actionname, object routevalues, object htmlattributes);
the overload you want is public static mvchtmlstring actionlink (this htmlhelper, string linktext, string actionname, string controllername, object routevalues), but it does not exist (it will reload ). Adding a null parameter is the following overload
Public static mvchtmlstring actionlink (this htmlhelper, string linktext, string actionname, string controllername, object routevalues, object htmlattributes );
This is exactly what you want. Add a null value after actionlink to conform to the next overload and generate it decisively. OK, default