Request.Params的Request.Form无法在Internet Explorer工作 [英] Request.Params Request.Form not working in Internet explorer

查看:206
本文介绍了Request.Params的Request.Form无法在Internet Explorer工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我面临着没有帮助任何地方这种愚蠢的问题。我面对它在我的MVC2项目的每个表单。

hello i am facing this stupid issue with no help any where. i am facing it in every form in my mvc2 project.

这是一个输入

<input type="image" src="<%=Url.Content("~/images/shopping-cart.jpg")%>" alt="shopping cart" id="btnshoppingCart" name="btnshoppingCart" value="shoppingCart" />

当我浏览与Firefox页面,点击输入Request.Params [btnshoppingCart]!= null或的Request.Form [btnshoppingCart]!= null被statisfied。

when i browse the page with firefox and click on the input Request.Params["btnshoppingCart"] != null or Request.Form["btnshoppingCart"] != null is statisfied.

当我浏览同一个网页与Internet Explorer 8,点击相同的输入Request.Params [btnshoppingCart]!= null或的Request.Form [btnshoppingCart]!= null是不满意。当我用手表我看到有一个由btnshoppingCart的在任的Request.Form或Request.Params名字没有按键,如果输入从Internet Explorer点击。然而,当它被从Firefox点击有值购物车内的Request.Form和Request.Params反对btnshoppingCart键。我观察到一个更奇怪的是,两个键btnshoppingCart.x和btnshoppingCart.y既与的Request.Form里面Request.Params whenver点击是来自Internet Explorer和Firefox进行。这是对不论类型的图像的所有输入发生的事情如果输入是一个HTML表单或里面没有present。形式是这样的创建

When i browse the same page with internet explorer 8 and click on the same input Request.Params["btnshoppingCart"] != null or Request.Form["btnshoppingCart"] != null is not satisfied. When i used the watch i saw that there is no key by the name of "btnshoppingCart" in either Request.Form or Request.Params if input is clicked from internet explorer. However when it is clicked from firefox there is value "shoppingCart" inside Request.Form and Request.Params against "btnshoppingCart" key. One more strange thing that i observed was that are two keys "btnshoppingCart.x" and "btnshoppingCart.y" inside both Request.Form and Request.Params whenver clicking is done from both internet explorer and firefox. This is happening against all inputs of type image irrespective if the input is present inside a html form or not. Forms are created like this

&LT;%使用(Html.BeginForm(动作,控制器,FormMethod.Post))
       {%>
IE浏览器的版本是8.0和Firefox 3.6.6是

<% using (Html.BeginForm("Action", "Controller", FormMethod.Post)) {%> The version of internet explorer is 8.0 and firefox is 3.6.6

推荐答案

这是一个错误(功能吗?​​是的右)IE浏览器。

It's a bug (feature? yeah right) of IE.

请参阅: http://msdn.microsoft。 COM / EN-US /库/ ms535836%28VS.85%29.aspx

具体做法是:

x坐标下被提交
  与.X控件的名称
  所附,和y坐标是
  的名义提交
  与.Y控制追加。任何值
  属性被忽略。 src属性
  指定img元素。

The x-coordinate is submitted under the name of the control with .x appended, and the y-coordinate is submitted under the name of the control with .y appended. Any value property is ignored. The src property specifies the img element.

这篇关于Request.Params的Request.Form无法在Internet Explorer工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆