c# - Exception returning: unable to evaluate expression because the code is optimized or a native frame is on top of the call stack -
catch (exception ex) returning "unable evaluate expression because code optimized or native frame on top of call stack" in code:
cmsql = cnsql.createcommand(); cmsql.commandtext = strsql; cmsql.commandtype = commandtype.text; reader = cmsql.executereader(); if (reader.hasrows) { while (reader.read()) { session["user_email"] = reader["user_email"].tostring().trim(); session["user_birthday"] = reader["user_birthday"].tostring().trim(); } response.redirect("default.aspx"); }
what reason?
try adding parameter response.redirect
method. if use response.redirect without second parameter, exception threadabortexception
occurs.
response.redirect("default.aspx",false);
prb: threadabortexception occurs if use response.end, response.redirect, or server.transfer
Comments
Post a Comment