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.