Asp.net MVC generates "*/? Length = *"

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.