Here is the Ajax actual processing interface
<%@ WebHandler language= "C #" class= "Projectcodehandler"%> using System;
Using System.Web;
Using System.Collections.Generic;
Using AMPPROJECTMANAGER.BLL;
Using Ampprojectmanager.models; public class Projectcodehandler:ihttphandler {public void ProcessRequest (HttpContext context) {Contex
T.response.contenttype = "Text/plain";
String html = ""; Here, the parameter gets in the context. request.params["Methodtype"]. ToString () switch (context. request.params["Methodtype"]. ToString ()) {case ' code ': HTML = Codehandler (context. request.params["Code"].
ToString ());
Break
Case "user": Break; } context.
Response.Write (HTML); Context.
Response.End ();
public bool IsReusable {get {return false; } public string Codehandler (string code) {list<string> List = projectmanager.getprojectbycod Ecode);//Please interpret this as: request to the database and all data starting with the current parameter, return to string list string html = "<ul>";
foreach (string temp in list) {html = html + "<li>" + temp + "</li>";
HTML = html + "</ul>";
return HTML; }
}
HTML code
<%@ Page language= "C #" autoeventwireup= "true" codefile= "Test.aspx.cs" inherits= "test"%> DOCTYPE html>
Have a day, the effect is as follows, enter any text, the system will go into the database search, click on the selected Li, will automatically fill in the value of Li in the textbox.
The main point is two: the first JQ is linked to the database on the page, which must be Ajax, or a direct call to the existence of the page, because consider going to go to MVC, so I'll stick a link here
http://blog.csdn.net/iouxyz/article/details/5691050
There is the asp.net how to achieve Ajax, that is. ashx. All known as: General procedures for processing files.
Combined with the above can achieve results