表达式已经过评估,没有任何价值 [英] Expression has been evaluated and has no value

查看:96
本文介绍了表达式已经过评估,没有任何价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

protected void lbkSelect_Click(object sender, EventArgs e)
{
  LinkButton btndetails = sender as LinkButton;

  GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;

  txtID.Text = GridView1.DataKeys[gvrow.RowIndex].Value.ToString();
  lblAirlineName.Text = gvrow.Cells[0].Text;
  lblDeparture.Text = gvrow.Cells[1].Text;
  lblArrival.Text = gvrow.Cells[2].Text;
  lblDuration.Text = gvrow.Cells[3].Text;
  lblStops.Text = gvrow.Cells[4].Text;
  Label labelPrice = (Label)gvrow.Cells[5].FindControl("Label1");

  lblPrice.Text = labelPrice.Text;

  this.ctlModalPopupExtender.Show();
}



将监视应用于this.ctlModalPopupExtender.Show();它告诉我:

表达式已经过评估,没有任何价值。并且它在弹出窗口中不显示值。




On applying watch to this.ctlModalPopupExtender.Show(); it shows me:
expression has been evaluated and has no value. And it does not display value on popup.

推荐答案

表达式已被评估,没有任何价值。意味着调试器运行表达式并且它没有返回任何东西。这意味着Show方法没有返回值,但调试器运行它。



什么是modalpopupextender?它是AJAX库的一部分吗?你正在做一个回发,所以你没有使用AJAX(除非AJAX库正在这样做)?如果您正在进行AJAX回发,为什么还要让AJAX控件显示自己呢?



我没有使用ASP.NET AJAX库(这是可怕的)但是这篇文章服务器端代码的ModalPopupExtender [ ^ ]似乎表明你正在做的是正确的。当然,当你在调试器中调用方法时,控件将不会显示,该方法只会告诉控件在呈现页面时显示自己。你知道吗,对吧?
"expression has been evaluated and has no value." means the debugger ran the expression and it didn''t return any thing. It means the Show method has no return value, but the debugger ran it.

What is a modalpopupextender ? Is it part of the AJAX library ? You''re doing a postback, so you''re not using AJAX ( unless the AJAX library is doing it ) ? If you''re doing an AJAX postback, why do you want to ask an AJAX control to show itself as well ?

I don''t use the ASP.NET AJAX library ( it''s horrendous ) but this article ModalPopupExtender from Server Side Code[^] seems to indicate that what you''re doing is right. The control will, of course, not show when you call the method in the debugger, the method would just tell the control to show itself when the page is rendered. You know that, right ?


这篇关于表达式已经过评估,没有任何价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆