有時(shí),當(dāng)我們?cè)较肓私庖粋€(gè)知識(shí),越覺(jué)得自己很無(wú)知,但是在這之前,你知道一個(gè)或兩個(gè)的片面觀點(diǎn)嗎?其實(shí)Ajax有很多優(yōu)點(diǎn),下面是錯(cuò)新技術(shù)頻道小編分享的ASP.NET中Ajax怎么使用,一起來(lái)看看吧!
在ASP.NET中應(yīng)用Ajax的格式如下:
前臺(tái)代碼(用JQuery庫(kù))
$.ajax({ type: "POST", async: true, url: "../Ajax/ajax.ashx", dataType: "html", data: null success: function (result) { //do successful sth }, error: function (XMLHttpRequest, textStaus, errThrown) { //do error sth }})Ajax(一般性處理程序)中代碼如下:
public void ProcessRequest (HttpContext context) {context.Response.ContentType = "text/plain";string result = "Hello World";context.Response.Write(result);}怎么樣,你對(duì)ASP.NET中Ajax怎么使用,是否了解了呢?歡迎您在評(píng)論部分發(fā)表評(píng)論,錯(cuò)新技術(shù)頻道小編認(rèn)為這是個(gè)不錯(cuò)的文章。
新聞熱點(diǎn)
疑難解答
圖片精選