【问题标题】:Getting exception like Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.?由于代码已优化或本机框架位于调用堆栈顶部,因此无法评估表达式之类的异常。?
【发布时间】:2011-04-13 13:28:30
【问题描述】:

我收到此错误:无法评估表达式,因为代码已优化或本机框架位于调用堆栈顶部。

这是我遇到错误的代码。

if (Session["edit"].ToString() == "y" || Session["master"].ToString() == "y" || Session["del"].ToString() == "y")
                {
                    btncancel.Text = "Cancel";
                    //txtprodesc.Text = txtpronm.Text = "";
                    ds = new DataSet();
                    ds =settcls.SelectallproductSuppliersetting();
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        btnsave.Enabled = btnedit.Enabled = false;
                        txtsetproductid.Visible = false;
                        txtpreid.Visible = true;
                        lbmsg.Visible = true;
                        lbmsg.Text = "Enter Productid";
                        txtpreid.Focus();

                        Response.Redirect(this.Page.AppRelativeVirtualPath);
                    }

【问题讨论】:

    标签: asp.net


    【解决方案1】:

    试试这个:

    Response.Redirect(this.Page.AppRelativeVirtualPath,false);

    【讨论】:

      【解决方案2】:

      进行重定向,或者括号中的前面的代码没有运行。这也是来自调试的消息......对吗?我认为在发布模式下可以抛出此消息,因为无法进行跟踪或其他东西,但这实际上不是问题。

      【讨论】:

      • 先生。 Aristos 我解决了我在谷歌搜索的问题,我得到了答案,我这样写:Response.Redirect(this.Page.AppRelativeVirtualPth,false);
      猜你喜欢
      • 2012-07-11
      • 2013-05-08
      • 2012-10-22
      • 1970-01-01
      相关资源
      最近更新 更多