Unable to Evaluate Expression because the code is optimized or a native frame is on top of callstack


Error:

Unable to Evaluate Expression because the code is optimized or a native frame is on top of callstack

Cause:

when we declare the "Respone.Redirect" method in the try block the error will occur

Solution

1.Its better to specify the "Response.Redirect" method out side the try block

2.or else use this syntax



Response.Redirect("Somepage.aspx",false);



Error Description
When we declare the Response.Redirect method in the try block it will automatically call the Response.End method.

So to stop calling internally the Response.End Method we are providing the endparamter to be false



Cheers,
Myself


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: