I'm using a required field validator inside web WARP and when validation fails and a postback occur even though it shouldn't.
When using an Update Panel it does not postback and also with no panel, it also doen't postback.
I've created a sample web page which demonstrates this behaviour. Am I missing something?
<body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
<div> <igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" Height="20px" Width="80px"> <table> <tr> <td> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="TextBox1" runat="server" EnableClientScript="true" EnableViewState="true" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator> </td> </tr> <tr> <td> </td> <td> <asp:Button ID="Button1" runat="server" Text="Button" /> </td> </tr> </table> </igmisc:WebAsyncRefreshPanel> </div> </form></body>
Thanks Matt, I've also find this solution, hoped there is something more "built-in".
almes
HI,
I wired up the Warp's RefreshRequest Client-side event.
In this event, I check the Page_IsValid property and if its not true - I cancel the post back.
Here is my code snippet
function WebAsyncRefreshPanel1_RefreshRequest(oPanel,oEvent,id){ //Add code to handle your event here. //debugger; if (!Page_IsValid) { oEvent.cancel = true; }}