我必须添加 CausesValidation="False";使每个 ASP Button 都能工作,为什么? [英] i must add CausesValidation="False" to every ASP Button to work, why?

查看:19
本文介绍了我必须添加 CausesValidation="False";使每个 ASP Button 都能工作,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我有一个大 ASP 页面,我必须在每个 ASP 按钮中设置:

Hello i have a Big ASP Page and i must set in every ASP Button this:

CausesValidation="False" 

上班.如果不这样做,它就无法运行代码隐藏功能.

to work. If don't it cant run a codebehind function.

有人可以向我解释为什么会这样吗?

can somebody explain to me why this is so?

推荐答案

您似乎在页面中使用了验证控件.您的页面必须在回发到服务器之前通过验证.以下是 CausesValidation 属性的功能:

It seems you are using Validation controls in your page. Your page must pass the validation before postback to server. Below is the functionality of CausesValidation property:

  • CausesValidation 属性指定页面是否在按钮控件被点击.

  • The CausesValidation property specifies if a page is validated when a Button control is clicked.

默认情况下单击按钮时会执行页面验证.

Page validation is performed when a button is clicked by default.

此属性主要用于在单击取消或重置按钮时阻止验证.

This property is mostly used to prevent validation when a cancel or reset button is clicked.

这篇关于我必须添加 CausesValidation="False";使每个 ASP Button 都能工作,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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