Start with Ajax.NET

Related Tags:

  Ajax.NET Professional 

  Microsoft.NET Framework 2.0 

  Ajax.net Professional Profile: 

  Ajax.net is a response. NET platform services-Ajax Framework (Microsoft has a framework called Atlas, on the Atlas see Dflying Chen's Blog), which allow you to call the client. NET, you can also access to the relevant source code. However, its license agreement is not very clear. 

  Contact original author: http://weblogs.asp.net/mschwarz/contact.aspx 

  Original author of Blog: http://weblogs.asp.net/mschwarz/ 

  If you have questions or find a Bug please visit: Google group Ajax.NET Professional. 

  Original author of the e-mail address: 
  Michael Schwarz 
  Meisenweg 2 
  90547 Stein, Germany 


  Download Ajax.NET Pro (5.11.4.2), including against. NET1.1 (C #) and. NET2.0 (C # / VB.NET). 

  Let us start from here it: Ajax.NET novice guidelines 

  First, add the AjaxPro.2.dll references (for the. NET Framework 1.1 Add AjaxPro.dll) 

  Then, add the web.config configuration file, add the following lines: 

  A    <? Xml version = "1.0" encoding = "utf-8?"> 
2 <configuration>
3 <appSettings/>
4 <connectionStrings/>
5 <system.web>
6 <httpHandlers>
7   <add Verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/> 
8   </ HttpHandlers> 
9 [ ]
10   </ System.web> 
11   </ Configuration> 
12

  Mean that all the ajaxpro / *. ashx request by Ajax.PageHandlerFactory handle, and not by default System.Web.UI.PageHandlerFactory processing plant to deal with them. 


  Now we write a AjaxMethod server, the server he and the general methods only difference is that he must add a method of the above [AjaxPro.AjaxMethod], the code below: 

  A  [AjaxPro.AjaxMethod]
2   Public int AddTwo (int firstInt, int secondInt) 
3   ( 
4   SecondInt return firstInt +; 
5   ) 

  To use Javascript on the client call. NET, you must also be registered these methods: 

  A    Protected void Page_Load (object sender, EventArgs e) 
2   ( 
3   AjaxPro.Utility.RegisterTypeForAjax (typeof (_Default)); 
4   ) 

  Finally, we write the script called client server approach (code detailed in the Notes). 

  Following is the outlook Default.aspx code: 

  A    <% @ Page Language = "C #" AutoEventWireup = "true" CodeFile = "Default.aspx.cs" Inherits = "_Default"%> 
2
3   <DOCTYPE html PUBLIC "- / / w3c / / DTD XHTML 1.0 Transitional / / EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
4   <html Xmlns="http://www.w3.org/1999/xhtml"> 
5   <head Id="Head1" runat="server"> 
6   <title> Untitled Page </ title> 
7   </ Head> 
8 <body>
9   <form Id="form1" runat="server"> 
10 <div>
11   <input Id="Text1" type="text" onchange="add()"/> 
12 +
13   <input Id="Text2" type="text" onchange="add()"/> 
14 =
15   <span Id="result"> </ span> 
16   </ Div> 
17   </ Form> 
18
19   <script Type="text/javascript"> 
20   Function add () 
21   ( 
22   Var a = document.getElementById ( 'Text1'). Value; 
23   Var b = document.getElementById ( 'Text2'). Value; 
24   Var a1 = parseInt (a); 
25   Var b1 = parseInt (b); 
26
27   _Default.AddTwo (A1, b1, getAdd_callback); / / asynchronous server-side method call 
28   ) 
29
30   Function getAdd_callback (rel) 
31   ( 
32   / / MyDemo._Default.GetServerTime () came from the server by the data object, to write. Value 
33   Document.getElementById ( "result"). InnerHTML = rel.value; 
34   ) 
35
36   </ Script> 
37
38   </ Body> 
39   </ Html> 
40

  Following is a complete Background Default.aspx.cs code: 

  Using System; 
  Using System.Data; 
  Using System.Configuration; 
  Using System.Web; 
  Using System.Web.Security; 
  Using System.Web.UI; 
  Using System.Web.UI.WebControls; 
  Using System.Web.UI.WebControls.WebParts; 
  Using System.Web.UI.HtmlControls; 

  Public partial class _Default: System.Web.UI.Page 
  ( 
[AjaxPro.AjaxMethod]
  Public int AddTwo (int firstInt, int secondInt) 
  ( 
  SecondInt return firstInt +; 
  ) 

  Protected void Page_Load (object sender, EventArgs e) 
  ( 
  AjaxPro.Utility.RegisterTypeForAjax (typeof (_Default)); 
  ) 
  ) 




Related articles:

Making use of the form page 5:00 skills
  We are presumably used in the page form, if you monotonous form of the control unit is not satisfied with, we might as well look at several techniques:    1, the mobile form text input options: in the text input column, if acceded to the tips, visitors often choose to use the mouse...
CSS: Beyond the layout grid
  CSS: Beyond grid layout - Welcome to the CSS software tutorial area天极    Original Author: Molly E. Holzschlag    From Original: Thinking Outside the Grid    Chinese translation: 54player.com - nobita (2006-06-01)    "Aerials, in the sky, when ...
QuickWAP building components using Wap site Directory
  QuickWAP building components using Wap site Tutorial - for articles    First of all we have to find out what is simple QuickWAP, QuickWAP V1.0 is a streamlined version of WAP1.2 Based on the agreement, the development of VB6 using an auxiliary language prepared by the ASP WML WAP p...
AS you with the quick draw simple and practical menu
  The ultimate effect Preview:  <embed src="http://www.webjx.com/img/flashs2004090710.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="550" height="100">   [Annex: source files download]    So...
LOADING pure AS dynamic can be opened 12 random effects
  / / Load the need to use the class    Import mx.transitions.Tween;    Import mx.transitions.easing .*;    / / Initialization parameters    Var _this: this MovieClip = / / progress of the total length    Var bar_width: Number = 200; / / of...