ASP. NET page no flush request implementation
<%@ Page Language="C #"AutoEventWireup="true"codebehind="OmAjaxSubmit.aspx.cs"Inherits="OMDemo.demo.omAjaxSubmit" %><!DOCTYPE HTML><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Headrunat= "Server"> <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /> <title></title> <Scriptsrc=".. /operamasks-ui/jquery-1.7.1.js "></Script> <Scriptsrc=".. /operamasks-ui/operamasks-ui.min.js "></Script> <Linkhref=".. /operamasks-ui/themes/apusic/operamasks-ui.css "rel= "stylesheet" /> <Script> varBtnclick; $ (document). Ready (function () { vartype; Btnclick= functionBtnclick (btn) {vartxt=$ (BTN). Val (); Type=txt; } $('#form1'). Bind ('Submit', function(e) {e.preventdefault ();//prevent form from default commit behavior varbtn=$ (e); $( This). Omajaxsubmit (//Submitting using AJAX{data: {Type:type},//target: "#output"target:document.body}); }); }); </Script></Head><Body> <formID= "Form1"runat= "Server"> <Div> <inputtype= "text"runat= "Server"name= "Name"ID= "Name"value=" " /> <inputtype= "text"runat= "Server"name= "Age"value=" "ID= "Age" /> <Asp:buttonID= "Button1"runat= "Server"Text= "Add"OnClientClick= "Btnclick (this)" /> <Asp:buttonID= "Button2"runat= "Server"Text= "Edit"OnClientClick= "Btnclick (this)" /> <Asp:buttonID= "Button3"runat= "Server"Text= "Del"OnClientClick= "Btnclick (this)" /> <DivID= "Output"></Div> </Div> </form></Body></HTML>
The background is as follows:
UsingSystem;UsingSystem.Collections.Generic;UsingSystem.Linq;Usingsystem.web;UsingSystem.Web.UI;UsingSystem.Web.UI.WebControls;Namespaceomdemo.demo{PublicPartialClassOmAjaxSubmit:System.Web.UI.Page {Protectedvoid Page_Load (Objectsender, EventArgs e) {var type = request["Type"];if (type = ="Add") {var name = request["Name"];var age = request["Age"]; Response.Write ("Add to:"+ name +Age); Response.End (); }Elseif (type = ="Edit") {//response.write ("Modify:" + name.) Value + age. Value); Name. Value = China Song Xingju " ; //response.end (); " Span style= "color: #0000ff;" >else if (type = = del< Span style= "color: #800000;" > "" {Response.Write ( Delete: age. Value); //response.end ();