婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > html+ashx 表單提交示例

html+ashx 表單提交示例

熱門標(biāo)簽:浦發(fā)電話機(jī)器人提醒還款 征途美甲店地圖標(biāo)注 柳州電銷機(jī)器人公司 昆明語音電銷機(jī)器人價格 電銷語音機(jī)器人型號參數(shù) 太原400電話上門辦理 騰訊地圖標(biāo)注手機(jī) 百度地圖怎樣做地圖標(biāo)注 400電話如何申請取消
1,sumbit表單提交

WebForm1.aspx源碼:
復(fù)制代碼 代碼如下:

%@ 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="提交" />
/div>
/form>
/body>
/html>

submitForm.ashx源碼:
復(fù)制代碼 代碼如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NETFormDemo.ashx
{
/// summary>
/// submitForm 的摘要說明
/// /summary>
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;
}
}
}
}

2,ajax提交
HtmlPage1.html 源碼:
復(fù)制代碼 代碼如下:

!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源碼:
復(fù)制代碼 代碼如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NETFormDemo.ashx
{
/// summary>
/// Login 的摘要說明
/// /summary>
public class Login : IHttpHandler
{

public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
int first = Convert.ToInt32(context.Request.Params["i"]);
int sec = Convert.ToInt32(context.Request.Params["j"]);

int res = first + sec;
context.Response.Write(res);
context.Response.Write("fdd ff");

}

public bool IsReusable
{
get
{
return false;
}
}


}
}

標(biāo)簽:天門 蘭州 張家界 白山 新疆 陽泉 德陽 江蘇

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《html+ashx 表單提交示例》,本文關(guān)鍵詞  html+ashx,表單,提交,示例,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《html+ashx 表單提交示例》相關(guān)的同類信息!
  • 本頁收集關(guān)于html+ashx 表單提交示例的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 尉氏县| 克什克腾旗| 普陀区| 思南县| 佛学| 昌乐县| 舞阳县| 永寿县| 中江县| 巴楚县| 隆林| 乐平市| 合川市| 汉寿县| 繁峙县| 潮州市| 旺苍县| 磐安县| 赤水市| 青冈县| 荣成市| 淮北市| 荆州市| 垫江县| 商丘市| 襄城县| 左云县| 苏州市| 无极县| 兴义市| 额敏县| 周至县| 抚州市| 张掖市| 海晏县| 海宁市| 鄄城县| 长沙县| 利川市| 常州市| 阜城县|