html+ashx 表单提交示例
来源: 阅读:1742 次 日期:2014-08-28 14:28:06
温馨提示: 小编为您整理了“html+ashx 表单提交示例”,方便广大网友查阅!

这篇文章主要介绍了html+ashx 表单提交的具体实现,需要的朋友可以参考下

1,sumbit表单提交

WebForm1.aspx源码:

代码如下:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="NETFormDemo.ashx.WebForm1" %>

http://www.w3.org/1999/xhtml">

Baidu
map

submitForm.ashx源码:

代码如下:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

namespace NETFormDemo.ashx

{

///

/// submitForm 的摘要说明

///

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 源码:

代码如下:

http://www.w3.org/1999/xhtml">

Baidu
map

add.ashx源码:

代码如下:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

namespace NETFormDemo.ashx

{

///

/// Login 的摘要说明

///

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;

}

}

}

}

更多信息请查看IT技术专栏

更多信息请查看 网络编程
手机网站地址: html+ashx 表单提交示例
由于各方面情况的不断调整与变化, 提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!

2025国考·省考课程试听报名

  • 报班类型
  • 姓名
  • 手机号
  • 验证码
关于我们| 联系我们| 人才招聘| 网站声明| 网站帮助| 非正式的简要咨询| 简要咨询须知| 新媒体/短视频平台| 手机站点| 投诉建议
工业和信息化部备案号:滇ICP备2023014141号-1 云南省教育厅备案号:云教ICP备0901021 滇公网安备53010202001879号 人力资源服务许可证:(云)人服证字(2023)第0102001523号
云南网警备案专用图标
联系电话:0871-65099533/13759567129 获取招聘考试信息及咨询关注公众号:
咨询QQ:1093837350(9:00—18:00) 版权所有:
云南网警报警专用图标
Baidu
map