如何从aspx页面到代码隐藏页面获取eval值

问题描述:

我需要将databinder Eval的值设为文件后面的代码



我尝试过:



I need to get the value of databinder Eval to code behind file

What I have tried:

if (Request.QueryString["code"] != "")
            {
                var obj = GetFacebookUserData(Request.QueryString["code"]);
                ListView1.DataSource = obj;
                ListView1.DataBind();
                
            }







<tr>
                        <td>First Name:</td>
                        <td>
                             <%# Eval("first_name") %>">
                           <br />
                        </td>
                    </tr>

你已经拥有它...... data在obj中,是一个名为first_name的属性。 Eval只是访问您设置的任何数据源(在您的情况下为obj)。在您提出要求之前,我们不知道obj是什么类型或它看起来是什么样的,所以我们无法真正帮助解决具体问题。
You already have it...the data is in "obj" and is a property called "first_name". The Eval is simply accessing whatever you have set as the datasource (obj in your case). Before you ask, we don't know what type "obj" is or what it looks like so we can't really help with specifics.