MVC application uses jquery to receive URL parameters

Source: Internet
Author: User

In this exercise, "MVC application of jquery Dynamic Data generation" http://www.cnblogs.com/insus/p/3410138.html, I learned to use jquery to create URL links and set parameters.
Next, Insus.net also learns to receive this parameter in jquery and display this record.

Because it is getting a single record, create a stored procedure in the database first:

To create an entity:


To create a controller:



Next, we need to solve, jquery how to get the parameters of the address bar, jquery already has a solution example: http://www.jquery4u.com/snippets/url-parameters-jquery/
So this function can be copied:


Create a details.cshtml under views/fruit/to apply the layout _layout.cshtml view:



Real-time Operation Demo:

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.