Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..

In my page i have a textbox for which i am using Ajax Filtered texbox Extender to filter digits,a Require field validator to validate that textbox and a Submit button to submit the page.
The problem is When i am clicking the submit button required field validator is firing good as well as page is also going to code behind, i mean require field validator not stoping page to postback. validation is firing and next second page is postbacking.

Please help me.. Thanks advance.

XML
<asp:TextBox ID="txtpostalcode" runat="server" CssClass="multiline_textbox"MaxLength="6" Width="300px" TabIndex="3" onkeyup="Count(this.id)"></asp:TextBox>
                                                                            <ajax:FilteredTextBoxExtender ID="ftAddress1Zipcode" FilterType="Numbers" TargetControlID="txtpostalcode"runat="server">

XML
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"ControlToValidate="txtpostalcode"></asp:RequiredFieldValidator>
Posted

1 solution

make sure that CausesValidation property of your submit button is true ..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900