开发者

Validation control doesn't prevent PostBack request to server

I have big web page, among other there is TextBox and RequiredRangeValidator.

<asp:textbox id="tbNewSvrLic" runat="server" Te开发者_Python百科xt="0" BackColor="#FFFFA0" />

<asp:RangeValidator id="NewSvrLicValidator" ControlToValidate="tbNewSvrLic"
    runat="server" Type="Integer" MinimumValue="0"  MaximumValue="5"
    errormessage="Invalid value specified for Additional Server Licenses"
    Display="Dynamic"  />

<asp:button id="btnOrderSummary" OnClick="btnOrderSummary_Click"
    runat="server" text="Display" Visible="False" />

These control are non visible when page is loaded 1st time, but became visible after user do some actions on page and submit some data to server (there Visible status will be changed to true).

When invalid data (for example 10 value) is entered into 'tbNewSvrLic' control then required error message is displayed, but 'Display' button is still clickable and does post-back request to server.

Web site is working under .NET 4.0, very similar functionality is implemented for .NET 3.5, but works as expected...

Please advise. Any thoughts are welcome.

P.S. Probably I need to mention that error message (on validation controls) are displayed in black, not in red as usual...


Can you try using ValidationGroups as mentioned here ?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜