For some reason, when I click a button on my webpage, my textbox inpout validators will not fire until after postback? Does anyone know why this is hapening or how to get it to validate the textbox input before postback (therefore keeping it from posting
back)?
So, after MUCH testing, it appears that my Obout controls are not working correctly (i.e. validating BEFORE postback) when they are placed inside <asp:Content> tags on pages that reference a Master page.
However, the controls DO validate correctly (i.e. BEFORE postback) when placed on a regular ASPX page that does not reference any master pages.
Does anyone know how I could work around this? I have sent their support an email, but since I am using their free version, I may not ever hear back from them. At least that has been my experience in the past (although these are great controls and I highly
recommend them).
mattcase
Member
374 Points
518 Posts
TextBox Validation after postback
Feb 09, 2012 06:24 PM|LINK
Hi,
For some reason, when I click a button on my webpage, my textbox inpout validators will not fire until after postback? Does anyone know why this is hapening or how to get it to validate the textbox input before postback (therefore keeping it from posting back)?
Thanks.
karang
Contributor
2439 Points
918 Posts
Re: TextBox Validation after postback
Feb 09, 2012 06:25 PM|LINK
Hi
Are you using .net validation controls for doing validation.
Karan Gupta
http://gyansangrah.com
Please click "Mark as Answer" if this helped you.
MetalAsp.Net
All-Star
112051 Points
18235 Posts
Moderator
Re: TextBox Validation after postback
Feb 09, 2012 06:26 PM|LINK
I have some ideas but prefer not to speculate. How about posting your relevant HTML markup.
mattcase
Member
374 Points
518 Posts
Re: TextBox Validation after postback
Feb 09, 2012 06:28 PM|LINK
Thanks for your reply. Yes I am using the .net validation controls.
Here is my code:
<asp:Button ID="Button1" runat="server" Text="Test Button" CausesValidation="true" /> <br /> <asp:Label ID="PasswordLabel" runat="server" Text="Zip File Password:" ForeColor="Black" Font-Bold="true"></asp:Label> <span class="Red"> <obout:OboutTextBox ID="ZipPwdTextBox" runat="server"></obout:OboutTextBox></span><asp:RequiredFieldValidator ID="ZipPwdValidator" runat="server" ErrorMessage="New Password is required for Zip download" ControlToValidate="ZipPwdTextBox" ForeColor="Red" Display="Dynamic">*</asp:RequiredFieldValidator>srinanthuram
Contributor
6800 Points
1549 Posts
Re: TextBox Validation after postback
Feb 09, 2012 06:31 PM|LINK
hi
If you want validation to fire when your TextBox does a postback then be sure to set on the TextBox
thank u.
mattcase
Member
374 Points
518 Posts
Re: TextBox Validation after postback
Feb 09, 2012 06:32 PM|LINK
Thanks for your reply. I have posted the relevant HTML markup.
MetalAsp.Net
All-Star
112051 Points
18235 Posts
Moderator
Re: TextBox Validation after postback
Feb 09, 2012 06:35 PM|LINK
To eliminate the possiblity that it's related to the obout control, can you remove it and use a regular asp:textbox and test?
mattcase
Member
374 Points
518 Posts
Re: TextBox Validation after postback
Feb 09, 2012 06:40 PM|LINK
Hmmm, it does appear that it is related to the Obout textbox. Any ideas?
Thanks.
karang
Contributor
2439 Points
918 Posts
Re: TextBox Validation after postback
Feb 10, 2012 03:04 AM|LINK
Hi
Can you share the code of OboutTextBox control
Karan Gupta
http://gyansangrah.com
Please click "Mark as Answer" if this helped you.
mattcase
Member
374 Points
518 Posts
Re: TextBox Validation after postback
Feb 10, 2012 04:15 PM|LINK
UPDATE
So, after MUCH testing, it appears that my Obout controls are not working correctly (i.e. validating BEFORE postback) when they are placed inside <asp:Content> tags on pages that reference a Master page.
However, the controls DO validate correctly (i.e. BEFORE postback) when placed on a regular ASPX page that does not reference any master pages.
Does anyone know how I could work around this? I have sent their support an email, but since I am using their free version, I may not ever hear back from them. At least that has been my experience in the past (although these are great controls and I highly recommend them).
Thanks.