English 中文(简体)
向残疾者发放表格的工作不可行
原标题:Submitting Form to Handler is not working
  • 时间:2009-10-13 01:07:07
  •  标签:

我正试图向手提一页提交表格,但现在没有任何工作,甚至打着手。

我的法典如下:

<form action="Unsubscription.ashx?actionmethod=subscribe" method="get" >
<div class="h1">
<input type="text" class="input" value="enter your e-mail" name="ekey"  />
<input type="submit" value="Submit" />
</div>
</form>

手法:

public void ProcessRequest(HttpContext context)
{
    try
    {
        string email = context.Request.Params["ekey"];
        switch (context.Request.Params["actionmethod"])
        {

            case "subscribe":
                NewsLetter.Subscribe(email);
                break;
            case "unsubscribe":
                NewsLetter.Unsubscribe(email);
                context.Response.ContentType = "text/html";
                context.Response.Write("your subscription has been successfully canceled. thanks.<br/><a href= http://www.kayatax.com ><b>home page</b></a>");
                break;
        }


    }
    catch         {
        context.Response.ContentType = "text/html";
        context.Response.Write("This e-mail doesn t exist in our database. Thanks.<br/><a href= http://www.kayatax.com ><b>Home Page</b></a>");
    }
}
问题回答

页: 1 如我所知,请登录<代码></form>。

如果你有浏览器方造成问题,而且你没有打过服务器的手,我首先调查浏览器。 见通过电线传送的内容:在大火中,网络小组能够重载网页,提交表格,然后在网上小组查阅请求。 在第1条节(向表格处理页提出的要求)中,确保申请URL符合你的期望。 之后,将节点扩大,看望申请负责人。

我所想的第一项事情是,目标<编码>不订阅.ashx<>/code”是否与页的表格相同,或者是否有某种方式的路径图,这样可以看。 你们再使用纸质的URL;你们是否相信目标是你们认为的?

顺便提一下,请<>not<>>>>>><>>>><>>>/strong>使用GET方法编制材料,改变服务器的数据;为此使用POST。 它的工作比较少,但更为安全。 GET 申请应为“idempotent。 如果你利用GET启动一项改变服务器上的东西的行动,你可找到。 当你不期望他们成为时,他们会重新改变。 D oh!

你的表格主要使用HTTPGET。 查阅提交的URL和查询。 应当:

Unsubscription.ashx?actionmethod=subscribe&ekey=enter%20your%20email

这是否正确?

你没有名字供你参考,但这不应影响你们想要的东西。





相关问题