asp .net Validation not working in IE 10

拈花ヽ惹草 提交于 2019-12-12 15:31:14

问题


Has anyone come across this issue? I have required field validation on a form that I have tested and know works in IE 7-9, Firefox and Chrome but in IE 10 it allows the form to submit without doing any validation. The site is in .Net 3.5. I have done some research online but I can't find anything about this.


回答1:


Most probably support.microsoft.com/kb/2608565.

Which means that your old browser capabilities settings incorrectly recognize ie10 as a browser which doesn't support javascript (which of course is not true). The updated browser capabilities file corrects this problem.




回答2:


So I figured out a way around it. I had tried the hotfix and that didn't fix it but I added in Page.IsValid to the submit and it works fine now. I didn't think this would matter since validation is normally client side only but it seemed to do the trick.

Edit: I originally used an incorrect hotfix as mentioned support.microsoft.com/kb/2608565 will fix this issue. Also as mentioned I should always have the Page.IsValid in my submits in case javascript is turned off.




回答3:


Hope this can help out.

protected void Page_Init(object sender, EventArgs e)
    {
        Page.ClientTarget = "uplevel";
    }


来源:https://stackoverflow.com/questions/15745658/asp-net-validation-not-working-in-ie-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!