elsewhere home of a .NET geek

  Home  |   Contact  |   Syndication    |   Login
  21 Posts | 1 Stories | 52 Comments | 35 Trackbacks

News

This blog has random information about Managed Code and Design Pattern. Every day, while i code, the thoughts come in mind are the one you would be reading here.

If you're seeking me for asking any questions, please use the contact page of this site.

Twitter












Article Categories

Archives

Post Categories

Saturday, February 25, 2006 #

In .NET 2.0 i had a serious bug and screwed my head, for me the below code looks fine,

        try{

if (retVal == 0)
Response.Redirect("Success.aspx?evt=0");

if (retVal == -2) //Email-Id is already present
                Response.Redirect("Success.aspx?evt=1");

if (retVal == -1) //Some error occured
                Response.Redirect("Success.aspx?evt=2");

}
catch(Exception error)
{
Response.Redirect("Success.aspx?evt=2");
}
finally{}

I sware there is no bug in this code, when tried to execute this code it creates an exception

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

I was stunned by seeing once after i commented the try catch block, it worked fine. Guys, any idea about this?