asp.net之ajax

來源:互聯網
上載者:User

標籤:

ajax主要的作用是無重新整理的情況進行提交。

常用於用戶端組件資訊的提交。伺服器組件在asp.net中能夠正常的提交,而html組件則不能正常提交,在此情況下,就可以採用jquery的方式進行資料的非同步採集與提交。如頁面上一個,<input type="text" id="txtUserName">,則jquery方式<script type="text/javascript">var username=$(‘txtUserName‘).val();

$.post(‘處理頁面‘,{‘suername‘,username},function(data)(data)); 

</script>"

再建立一個ashx檔案(一般處理常式檔案),在裡面使用httpcontent.request.form[‘username‘]來擷取傳值,最後進行判斷,返回httpcontent.response.write("OK");

asp.net之ajax

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.