最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Why does my button output WebForm_DoPostBackWithOptions? - Stack Overflow

programmeradmin7浏览0评论

I need my page to work when JavaScript has been disabled. But my button is outputting onclick="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?

I need my page to work when JavaScript has been disabled. But my button is outputting onclick="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?

Share Improve this question asked Dec 13, 2010 at 18:20 Junior DeveloperJunior Developer 1612 silver badges7 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

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)

  1. 暂无评论