0

ASPX code :

<asp:Button ID="medicalSub" runat="server" ValidationGroup="medical" Text="Save" CausesValidation="false" UseSubmitBehavior="false" ClientIDMode="Static" OnClick="medicalSub_Click" /> 

ASPX.CS code :

 protected void medicalSub_Click(object sender, EventArgs e)
        {
            console.writeline("hello");
        } 

Error

enter image description here

Ritesh Khandekar
  • 3,767
  • 3
  • 13
  • 29
  • Maybe this could help you. [Try this](https://stackoverflow.com/questions/8443344/invalid-postback-or-callback-argument-error/48534443) Regards, – Jsperk Feb 27 '20 at 13:34

2 Answers2

0

According to that stack trace, the problem is not calling the click method. Instead, it's failing trying to load viewstate for a dropdown list control. This is long before trying to handle any events.

Joel Coehoorn
  • 380,066
  • 110
  • 546
  • 781
0

Try this:

copy and paste this in your page load section of your code and check if that helps:

If(!IsPostBack)
{


}

Or the following will hep:

<%@ Page so just add the rest => EnableEventValidation="false" %>
Micha
  • 868
  • 4
  • 8