简体   繁体   English

没有回发的事件

[英]Event without postback

In chat scripts new lines adds without reloading page. 在聊天脚本中,新行添加而不重新加载页面。 User's availability status changes without postback. 用户的可用性状态更改,无回发。 Even in facebook a new comment adds without reloading page. 即使在Facebook中,新评论也会在不重新加载页面的情 How to fire an event in ASP.NET using C# so that event takes place with reloading the page. 如何使用C#在ASP.NET中触发事件,以便在重新加载页面时发生事件。

I believe that its not possible using C#. 我相信它不可能使用C#。 Is there any special library for it in AJAX or jQuery or other? 在AJAX或jQuery或其他中是否有任何特殊的库?

It's done using native XML components available from the browser when writing JavaScript. 在编写JavaScript时,它使用浏览器提供的原生XML组件完成。 These are used to call a server-side page or service to load a block of HTML (or XML) async, and then write it into the document. 这些用于调用服务器端页面或服务以加载HTML(或XML)异步块,然后将其写入文档。 This is essentially AJAX. 这基本上是AJAX。

JQuery is a library designed to make writing cross browser compatible scripts easier, and offers built in functionality to help make those AJAX calls for you, without you needing to do the low level bits yourself. JQuery是一个库,旨在使编写跨浏览器兼容的脚本更容易,并提供内置功能,帮助您进行这些AJAX调用,而无需自己执行低级别的操作。

ASP.NET has a range of tools for creating AJAX enabled sites, and recent versions now incorporate jQuery for the client side parts, without you needed to do much wiring up. ASP.NET提供了一系列用于创建支持AJAX的站点的工具,最近的版本现在将jQuery用于客户端部分,而无需进行大量的连接。 Together the tools make exposing and calling ASP.NET services really easy. 这些工具一起使得暴露和调用ASP.NET服务变得非常容易。 The simplest form is probably the UpdatePanel . 最简单的形式可能是UpdatePanel It's a good place to start if you have never made an AJAX enabled site before. 如果您之前从未创建过支持AJAX的网站,那么这是一个很好的起点。

Also take a look at the AJAX Toolkit . 另请参阅AJAX Toolkit

jQuery itself allows you to send GET and POST Ajax requests and manipulate with HTML elements jQuery本身允许您发送GET和POST Ajax请求并使用HTML元素进行操作

$.post(...

$.get(...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM