开发者

Asp.net Response.Redirect

开发者 https://www.devze.com 2023-02-27 07:57 出处:网络
I am using response.redirect after iam deleting a particular user to have grid populated with latest values.. but it giving me error

I am using response.redirect after iam deleting a particular user to have grid populated with latest values.. but it giving me error lblError.Text=Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

because of this error iam not getting confirmation of deletion any help will be appreciated

code:- if (chk.Checked == true) {

                        isDeleted=oFTE.DeleteUserRoleMapDetails(row.Cells[1].Text);
                        if (isDeleted == 0)
                        {
                            lblError.Visible = true;
                            lblError.ForeColor = System.Drawing.Color.Red;
                            lblError.Text = "User Role Map deletion failed.";
                        }
                        else if (isDeleted == 1)
                        {
                            lblError.Visible = true;
                            lblError.ForeColor = System.Drawing.Color.Red;                                
                            //Response.Redirect("userRoleMap.aspx");
                            Session["Msg"] = "User Role Map deleted successfully.";
                            Response.Redirect("userRoleMap.aspx",false);

                           //lblError.Text = "User Role Map deleted successfully.";                                 
                            break;
                        }                                                     
                    }

                    if (iRowCount == gridViewResults.Rows.Count)
                    {
                        lblError.Visible = true;
                        lblError.ForeColor = System.Drawing.Color.Red;
                        lblError.Text = "Please select 开发者_StackOverflowa row to delete.";
                    }
                }
            }
        }
        catch (Exception ex)
        {
            lblError.Visible = true;
            lblError.ForeColor = System.Drawing.Color.Red;
            lblError.Text = ex.Message.ToString();
        }           
    }      


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

Is only shown in the Locals/Watch windows when you've paused the debugger inside a native call. It's not an actual error preventing your page from loading. Perhaps, the problem is that you've set a breakpoint in your code and the request is timing out from the browser before you've resumed execution?


The message is coming from the debugger. Run your application without the debugger to see the real error.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号