This article mainly introduces the concrete implementation of the Html+ashx form submission, the need of friends can refer to the following
1,sumbit form submission WebForm1.aspx source: code as follows: <%@ Page language= "C #" autoeventwireup= "true" codebehind= " WebForm1.aspx.cs "inherits=" NETFormDemo.ashx.WebForm1 "%> <! DOCTYPE html> <html xmlns= "http://www.w3.org/1999/xhtml" > <head > <meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/> <title></title> <script type=" Text/javascript "> < /script> </head> <body> <form id= "Form1" action= "Submitform.ashx" > < div> <input type= "Submit" value= "submitted"/> </div> </form> </body> </html> SUBMITFORM.ASHX source code: codes are as follows: using system; using System.Collections.Generic; using system.linq; using system.web; namespace netformdemo.ashx { ///<summary& gt; ///SubmitForm's summary description ///</SUMMARY>&NBSp public class submitform:ihttphandler { public void ProcessRequest (HttpContext context) { Context. Response.ContentType = "Text/plain"; context. Response.Write ("Hello World"); } public bool isreusable { get { return false;& nbsp } } } } 2,ajax submit htmlpage1.html source code: the following: <! DOCTYPE html> <html xmlns= "http://www.w3.org/1999/xhtml" > <head> < title></title> <script src= "test1.js" type= "Text/javascript" ></script> <script Src= "Jquery-1.4.min.js" type= "Text/javascript" ></script> <script type= "Text/javascript" > function Add (URL) { var A = $ ("#a1"). Val (); var B = $ ("#b1"). Val (); $.ajax ({ URL: "Ashx/add . ashx?i= "+ A +" &j= "+ b, data: { num1:a, num2:b }, dataType:" HTML ", success: function (ResULT) { } }); } </script> </head> <body> <form id= " Form1 "runat=" Server "> <input type=" Text id= "A1"/> <input type= "text" id= "B1"/> < Input type= "button" onclick= "Add ()"/> <label id= "lb" ></label> </form> </ body> </html> ADD.ASHX source: code is as follows: using system; using system.collections.generic; using system.linq; using system.web; namespace netformdemo.ashx& nbsp { ///<summary> ///Login's summary description ///</summary> public class login:ihttphandler { public void ProcessRequest (HttpContext context) { context. Response.ContentType = "Text/plain"; int-i = convert.toint32 (context. request.params["I"]); int sec = Convert.ToInt32 (context. Request.params["J"]); int res = the sec; context. RespoNse. Write (RES); context. Response.Write (' FDD ff '); } public bool isreusable { get { return false; } } } }