asp.net with Easyui implementation returns JSON data instance

Source: Internet
Author: User

Recently, I want to use asp.net with Easyui to develop a small framework, and then use to Easyui combobox when there is a problem, it is known that the Easyui document on the ComboBox format is

code is as follows: <input class= "Easyui-combobox"


name= "Language"


data-options= "


URL: '.. /combobox/combobox_data1.json ',


Valuefield: ' id ',


TextField: ' Text ',


Multiple:true,


panelheight: ' Auto '


">

In the beginning, I wanted to write with Ajax using the ASP.net micro-blogging [method] approach, but there was a problem with the AJAX approach using [method], which is the following format,

The

code is as follows: $.ajax ({


type: "Post",


URL: "Addbug.aspx/getversions",


data: "{' Producename ': '" + SelectedValue + "'}",


dataType: "JSON",


contentType: "Application/json; Charset=utf-8 ",


success:function (data) {


$ ("#versions"). empty ();


$ ("#versions"). Append (DATA.D);





});

That is, must write out its contenttype, but this for Easyui ComboBox data-options parameters are not, so that the return result contains a lot of HTML statements, tangled for a long time, Then accidentally tried the. ashx file and found it was successful.

Then I looked it up again. The role of the ashx file, in simple terms, is to provide the ability to return strings and pictures without returning processing results and a lot of HTML as in the case of an. aspx file.

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.