【问题标题】:How to get code behind variable value into repeater如何将变量值后面的代码放入转发器
【发布时间】:2014-04-30 16:48:29
【问题描述】:

我在 asp.net 文件后面的代码中有一个变量,比如 string myVariable = "SomeValue";

我在代码隐藏中使用了这个声明:

  Public myVariable As String = "SomeValue"   

我想把这个字符串绑定在中继器里面。

 <td id="Td5" class="Text" style="text-align:right; width:70px;" >
        <%#DataBinder.Eval(Container, "'<%=myVariable%>'", "{0:N2}")%>
 </td>

Repeater 使用数据表绑定。我用vb.net

感谢你们的cmets。

【问题讨论】:

  • 你应该可以做到&lt;%#DataBinder.Eval(Container, myVariable, "{0:N2}")%&gt;

标签: asp.net vb.net datatable repeater


【解决方案1】:

在 session 中设置你的值,然后将 sessionh 与 &lt;%=Session("yourfiledName")%&gt; 绑定

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-10
    • 2021-01-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多