當前位置:名人名言大全網 - 端午節短信 - ASP.NET如何使用jQuery跨域獲取驗證碼並驗證它?

ASP.NET如何使用jQuery跨域獲取驗證碼並驗證它?

只需放入jquery-1.4.2.min.js或jquery-1.3。項目文件夾中的*。min。js。在aspx中引用。

& lt腳本& gt

函數LoadData()

{

$.ajax({

類型:“獲取”,

網址:“*****。aspx“,

數據:“type = testAjax & ampnum =“+math . random(),

成功:功能(消息)

{

後臺數據消息

}

});

}

& lt腳本& gt

觸發上面的事件方法。

* * * * * *。aspx。cs

受保護的void Page_Load(對象發送方,EventArgs e)

{

如果(請求。查詢【“type“】= =“testa jax“)

{

//您的邏輯處理

//最後,您只需要添加以下內容。

回應。content type =“text/plain“;

回應。Buffer = true

回應。ExpiresAbsolute =日期時間。now . AddDays(-1);

回應。add header(“pragma“,“no-cache“);

回應。add header(“cache-control“,““);

回應。cache control =“no-cache“;

//result要返回到頁面的值。

回應。寫(結果);

回應。end();

}

}

我可以幫妳。妳設好我的最佳答案後,我教妳百度Hii。