You are here : Home » knowledge exchange


Unable to evaluate expression

ex = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call
stack.}

we get this type of error when we had used Response.Redirect() method in try block.


try
{
SmtpMail.Send(loMailData);
}
catch (Exception ex)
{
Response.Redirect("failure.html");
}
Response.Redirect("thanks.html");
in this it'll throw an exception beacause we had used Response.Redirect() in try block.Solution :remove the Response.Redirect() from try block and put it after the catch block.
try{
SmtpMail.Send(loMailData);
Response.Redirect("thanks.html");
}
catch (Exception ex)
{
Response.Redirect("failure.html");
}


Knowledge Exchange about Php Java, Asp.Net, SEO At Narola Infotech



Copyright © 2005-2012 Narola Infotech, Custom Software & Website Development Company | All Rights Reserved.

Find Us on