开发者

Why does my button output WebForm_DoPostBackWithOptions?

开发者 https://www.devze.com 2023-01-30 14:12 出处:网络
I need my page to work when JavaScript has been disabled. But my button is outputting onclick=\"开发者_StackOverflow社区WebForm_DoPostBackWithOptions...\". When I set CauseValidation=\"false\" it disa

I need my page to work when JavaScript has been disabled. But my button is outputting onclick="开发者_StackOverflow社区WebForm_DoPostBackWithOptions...". When I set CauseValidation="false" it disappears but I need validation. In what circumstances is WebForm_DoPostBackWithOptions outputted? And how can I get around this problem?


Validation controls use both Client and Server validation. On the client, javascript is used for validation, and is required.

You can force validation controls to not use client script, which might help you with this issue.

<asp:RequiredFieldValidator EnableClientScript="false" />


Not including the ValidationGroup attribute can cause the same issue.

<asp:RequiredFieldValidator ValidationGroup="Save" />

Or the control to validate is incorrect

0

精彩评论

暂无评论...
验证码 换一张
取 消