Monday 13 October 2014

ASP.Net - GridView paging and sorting validation issues


In case you are receiving the following error while paging or sorting gridview

A potentially dangerous Request.Form value was detected from the client

in event viewer
Event code: 3003
Event message: A validation error has occurred.  


Watch this on YouTube:

add the following javascript function
    <script type="text/javascript">
        function validate(){
            var result = Page_ClientValidate();
            return result;
        }
    </script>


and modify form tag, from
    <form id="form1" runat="server">
to 
    <form id="form1" runat="server" onsubmit="return validate();">

No comments:

Post a Comment