How to add a test tool on the Help Page

Source: Internet
Author: User

In the previous article, I used ASP. NET adds a Help Page. In this article, I plan to add a test tool to the page so that we can directly test the API during development, which is very beneficial to development!

You can also read this article to add Test Tool: http://blogs.msdn.com/ B /yaohuang1/archive/2012/12/02/adding-a-simple-test-client-to-asp-net-web-api-help-page.aspx

  

  

Click Install.

The following files will be added to your project:

    Scripts \ WebApiTestClient. js
  • Areas \ HelpPage \ TestClient.css
  • Areas \ HelpPage \ Views \ Help \ DisplayTemplates \ TestClientDialogs. cshtml
  • Areas \ HelpPage \ Views \ Help \ DisplayTemplates \ TestClientReferences. cshtml

At this time, we need to modify this file:

 <link type= href= rel= /> <div id= =>     <section =>         <div =>             <p>                 @Html.ActionLink(,              </p>         </div>     </section>     <section =>      </section> </div> @Html.DisplayForModel(      <link type= href= rel=/>     @Html.DisplayForModel( }

Yes, that's simple.

You need to be sure that your package must be on this or above:

    JQuery 1.7.1
  • JQuery. UI. Combined 1.8.20
  • Knockoutjs 2.1.0

3. Check the page.

Find any API on the Help page and click to view it. You will find a Test API button in the lower right corner. Click the Test tool we want.

  

The returned result is correct.

 

Remember this and learn later.

 

Related Article

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.