Last post Jul 22, 2018 09:53 AM by mudassarkhan
Jul 20, 2018 11:24 AM|VIKTORW|LINK
I have a textbox control which is in an Update panel and have the autopostback as TRUE, logic in the TextChanged event and AsyncPostBackTrigger in the Trigger section.
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<asp:AsyncPostBackTrigger ControlID="txtBox1" EventName="TextChanged" />
Protected Sub txtBox1_TextChanged(sender As Object, e As EventArgs) Handles txtBox1.TextChanged
What is happening, when I tab out of the control with no value in it, the RFV text displays briefly and then disappears. If I don't autopostback it works, otherwise it disappears. It obviously has to do with the autopostback, has anyone encountered this
before and if so, what solution did you use?
For now I have MacGyver'd it by adding a label control with some logic in the TextChanged event on the autopostback but would prefer to use the RFV.
In addition, I am also using a RegularExpressionValidator with the textbox control and it behaves the same way with the autopostback.
Thank you for your help,
Jul 20, 2018 01:03 PM|mudassarkhan|LINK
Jul 20, 2018 02:38 PM|VIKTORW|LINK
That is perfect, works like a charm.
Comments below helped me:
11-14-2007 05:26 AM|LINK
If you want to validate your AutoPostBacked TextBoxes, you have to call the Page.Validate() method on the
That way, your ErrorMessages won't disappear after the PostBack.
Thank you very much for your help mudassarkhan, much appreciated.
Jul 22, 2018 09:53 AM|mudassarkhan|LINK
Please mark my reply as Answer for others to get reference and help.