I got it...
I have used Response.Redirect("SomePage.aspx", true).
Due to this I am getting Unable to evaluate expres sion because the code is optimized or a native frame is on top of the call stack.
Just replaced true with false in Response.Redirect. and it would work.