资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

html中怎么利用ashx实现表单提交-创新互联

今天就跟大家聊聊有关html中怎么利用ashx实现表单提交,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

成都创新互联公司专注于肇庆企业网站建设,响应式网站,商城开发。肇庆网站建设公司,为肇庆等地区提供建站服务。全流程定制网站,专业设计,全程项目跟踪,成都创新互联公司专业和态度为您提供的服务

1,sumbit表单提交

WebForm1.aspx源码:


复制代码 代码如下:


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


















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


复制代码 代码如下:
























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;
}
}


}
}


看完上述内容,你们对html中怎么利用ashx实现表单提交有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注创新互联行业资讯频道,感谢大家的支持。


网页题目:html中怎么利用ashx实现表单提交-创新互联
URL标题:http://cdkjz.cn/article/dhijsh.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220