2
Reply

nvalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %>

Ravi Shesham

Ravi Shesham

Apr 24 2008 9:04 PM
5.5k

Hi All,

I am getting the above error when click on Ok button on confirm message box in web application.

This is my requirement.

When I click on the Search button on web page it should check the data in db then it should be display Confirm message dialog "Do u want to load the data" if user click yes it should load the data in page and it is working fine in my system (localhost),when I copy the same code in server and I am accessing web page from my machine using IE it giving the above error.Please any one help on this it is urgent thanks in advance...

//Button event

private void btn_Search_Click(object sender, System.EventArgs e)
{
int intCount = m_bo_Bulkupload.CheckExistingData("Book1");
if ( intCount > 0 )
//calling method from msgbox.dll file
 MsgBox1.confirm("Book Already existed Do you want to re-load again?","hd1");   
}
//Page Load
private void Page_Load(object sender, System.EventArgs e)
 {
    if (!this.IsPostBack)
       {
  //Some code
       }
        else
      {
  if(Request.Form["hd1"]=="1")
    {
      Request.Form["hd1"].Replace("1","0");
      DataTable dtSearch =new DataTable();
      dtSearch= m_bo.Getload("Book1");
      }
      }
}

//this the code for the MsgBox1.Confirm from (msgbox.dll)
public void confirm(string msg,string hiddenfield_name)
 {
   string  sMsg = msg.Replace( "\n", "\\n" );
   sMsg =  msg.Replace( "\"", "'" );
   StringBuilder sb = new StringBuilder();
   sb.Append( @"<INPUT type=hidden value='0' name='" + hiddenfield_name + "'>");
   sb.Append( @"<script language='javascript'>" );
   sb.Append( @" if(confirm( """ + sMsg + @""" ))" );
   sb.Append( @" { ");
   sb.Append( "document.forms[0]." + hiddenfield_name + ".value='1';" + "document.forms[0].submit(); }" );
   sb.Append( @" else { ");
   sb.Append("document.forms[0]." + hiddenfield_name + ".value='0'; }" );
   sb.Append( @"</script>" );
   content=sb.ToString();
}

 

 


Answers (2)