当前位置: 代码迷 >> ASP.NET >> 给个ajax的例子,网上找来的都是出错。解决办法
  详细解决方案

给个ajax的例子,网上找来的都是出错。解决办法

热度:9495   发布时间:2013-02-25 00:00:00.0
给个ajax的例子,网上找来的都是出错。
如何能够实现aspx页面的无刷新调用cs事件。

------解决方案--------------------------------------------------------
www.asp.net
------解决方案--------------------------------------------------------
http://www.cnblogs.com/leoo2sk/archive/2008/07/22/1248660
------解决方案--------------------------------------------------------
http://blog.csdn.net/zhoubohua/archive/2008/09/20/2954245.aspx
很清楚了
------解决方案--------------------------------------------------------
异步回调,给个例子,当前还有其他方法
HTML code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CallBack_Default.aspx.cs" Inherits="CallBack_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server">    <title>使用.net回调(CallBack)技术实现局部刷新</title>    <script language="javascript">        function FillData()        {            var city = document.getElementById("TextBox1").value;            <% =ClientScript.GetCallbackEventReference(this,"city","FillDll",null) %>;        }                 function FillDll(strCity)        {           document.getElementById("DropDownList1").options.length = 0;           var indexofcity;           var city;           //分割传递来的字符串           while(strCity.length>0)           {             //判断是否是最后一个字符串             indexofcity = strCity.indexOf(",");             if (indexofcity > 0)             {                city = strCity.substring(0,indexofcity);               strCity = strCity.substring(indexofcity+1);               //填充DropDownList1               document.getElementById("DropDownList1").add(new Option(city,city));             }             else             {               document.getElementById("DropDownList1").add(new Option(strCity,strCity));               break;             }           }        }    </script></head><body>    <form id="form1" runat="server">    <div>        <strong>使用.net回调(CallBack)技术实现局部刷新</strong><br />        城市名称:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>        <input id="Button1" type="button" value="查 询" onclick="FillData()" /><br />        城镇:<asp:DropDownList ID="DropDownList1" runat="server">        </asp:DropDownList></div>    </form></body></html>
------解决方案--------------------------------------------------------
呵呵
------解决方案--------------------------------------------------------
无刷新应用和数据传递
参考
http://www.cnblogs.com/sunheyubo/articles/838496http://www.cnblogs.com/lingxzg/articles/488484
------解决方案--------------------------------------------------------
顶了 

刚建一c#群 63242231 希望有志同道合的朋友和高手指导 

谢谢。。。呵呵呵
------解决方案--------------------------------------------------------
上边已经给的很多了.
------解决方案--------------------------------------------------------
探讨
呵呵,谢谢各位啊,这些教程其实都挺好

你们用ajax都做些什么?主要哪方面?

------解决方案--------------------------------------------------------
http://download.csdn.net/source/795407
  相关解决方案