Whidbey中无刷新机制
点击次数:20 次 发布日期:2008-11-26 09:49:35 作者:源代码网
|
源代码网推荐 <%@ Implements Interface="System.Web.UI.ICallbackEventHandler" %> 源代码网推荐 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 源代码网推荐 源代码网推荐 <script runat="server"> 源代码网推荐 protected void Page_Load(object sender, EventArgs e) 源代码网推荐 { 源代码网推荐 string callback = Page.GetCallbackEventReference(this, "this.value", "ProcessReverse", null); 源代码网推荐 this.TextBox1.Attributes.Add("onchange", callback); 源代码网推荐 } 源代码网推荐 源代码网推荐 string ICallbackEventHandler.RaiseCallbackEvent(string eventArgument) 源代码网推荐 { 源代码网推荐 char [] chars = eventArgument.ToCharArray(); 源代码网推荐 Array.Reverse(chars); 源代码网推荐 return new string(chars); 源代码网推荐 } 源代码网推荐 </script> 源代码网推荐 源代码网推荐 <html xmlns="http://www.w3.org/1999/xhtml" > 源代码网推荐 <head runat="server"> 源代码网推荐 <title>Untitled Page</title> 源代码网推荐 </head> 源代码网推荐 <body> 源代码网推荐 <form id="form1" runat="server"> 源代码网推荐 <div> 源代码网推荐 <asp:TextBox ID="TextBox1" Runat="server"></asp:TextBox> 源代码网推荐 </div> 源代码网推荐 源代码网推荐 </form> 源代码网推荐 </body> 源代码网推荐 </html> 源代码网推荐 <script> 源代码网推荐 function ProcessReverse(result,context) 源代码网推荐 { 源代码网推荐 document.all.TextBox1.value = result; 源代码网推荐 } 源代码网推荐 </script> 源代码网推荐 做人要厚道,请注明转自酷网动力(www.ASPCOOL.COM)。 源代码网推荐 源代码网供稿. |
