rskshiva
01-29-2005, 06:27 AM
Hai,
While displaying a record to the user, User can delete the record by clicking the "Delete" button. we need to get confirmation from the user to delete the record. For this we have to display the alert message to the user.
I am not able to call the javascript function and get return value from the function to the codebehind file.
If i am calling the javascript function and submit the form with the record id, it displays the below error.
---------------------------------------------------------------------
Server Error in '/sahmTest' Application.
The viewstate is invalid for this page and might be corrupted.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The viewstate is invalid for this page and might be corrupted.
---------------------------------------------------------------------
Below is the javascript function
function verify(id)
{
if (confirm("Are you sure to delete?")==true)
{
document.Form1.method="post"
document.Form1.action="deleteform.aspx?id="+id;
document.Form1.submit();
____return true;
}
else
___return false;
}
and i had called the function as
btnDelete.Attributes.Add("onclick", "return verify(" & Id & ");")
Kindly suggest me. It is urgent.
Regards,
Siva R
While displaying a record to the user, User can delete the record by clicking the "Delete" button. we need to get confirmation from the user to delete the record. For this we have to display the alert message to the user.
I am not able to call the javascript function and get return value from the function to the codebehind file.
If i am calling the javascript function and submit the form with the record id, it displays the below error.
---------------------------------------------------------------------
Server Error in '/sahmTest' Application.
The viewstate is invalid for this page and might be corrupted.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The viewstate is invalid for this page and might be corrupted.
---------------------------------------------------------------------
Below is the javascript function
function verify(id)
{
if (confirm("Are you sure to delete?")==true)
{
document.Form1.method="post"
document.Form1.action="deleteform.aspx?id="+id;
document.Form1.submit();
____return true;
}
else
___return false;
}
and i had called the function as
btnDelete.Attributes.Add("onclick", "return verify(" & Id & ");")
Kindly suggest me. It is urgent.
Regards,
Siva R