Have some problems with client side validation (using RequiredFieldValidator, RegularExpressionValidator, CustomValidator with client side validation logic). It seems that WebForm_DoPostBackWithOptions is not fired or causes unhandled exception that makes the form to do the postback regardless it's valid or not.
I tried using a ValidationSummary, hiding it if javascript is supported:
<script>
$(document).ready(function() {
$("#javascriptDisabled").hide();
}
</script>
...
<div id="javascriptDisabled">
<asp:ValidationSummary runat="server" ...>
</div>
...
<asp:Button runat="server" OnClick="SendMessage" ...>
My .cs code is:
protected void SendMessage(object sender, EventArgs e)
{
if(!Page.IsValid) return;
}
Every thing works fine on Chrome with disabled javascript on my laptop, but not on my Android phone. The problem is that on the phone Javascript is not disabled, it's enabled, and correctly hides the ValidationSummary, but does not perform client side validation for some reason that i can't understand (no developers tools on Android browser :(( ). This is very frustrating! :(
Someone can help?
Thanks!
EDIT: I found the cause (but not the solution, if one exists). I'm using in my page a Telerik RadEditor control that, if the client is Android default browser, does not correctly render all the 开发者_运维百科embedded scripts that are required, causing javascript exceptions and (probably) the disactivation of javascript runtime by the browser. This causes the client side validation not working anymore. Will investigate with Telerik if there is a solution to this issue.
Try with fiddler. When I tryied, I must setup the emulator to work via fiddler proxy. Doing that in my app (I'm also putting data on a .NET authenticated WS), it worked.
Saludos, OSCAR.
EDIT: I found the cause (but not the solution, if one exists). I'm using in my page a Telerik RadEditor control that, if the client is Android default browser, does not correctly render all the embedded scripts that are required, causing javascript exceptions and (probably) the disactivation of javascript runtime by the browser. This causes the client side validation not working anymore. Will investigate with Telerik if there is a solution to this issue.
精彩评论