C# .NET - Server side btn click event not firing in post back

Asked By karur krishna madhu on 30-Sep-13 04:34 AM
Hi i have a text box and button. i need to first validate empty values in text box using javascript and if the validation succeeds then on click of the button a js pop up comes up with some mess"Do you like to proceed"? if the user clicks on yes then a server side button click event should be called.but i am getting some post back error.

 
    if (document.getElementById('txtvisit_id').value="")
    { showMsg = showMsg + "\n" + "Please enter visit id"; setfocusaftervalidate('RDBvisit_id1'); }
    else  if (confirm("Populate Customer fields with existing Visit Request Form entries.Continue?") == true) {
        __doPostBack('btn_GetVisitdetails', 'OnClick');
    }
    return false;

event validation is not there and i mentioned it as false and checked still it didnt work.

Error:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.