EVAL在C#中asp.net [英] EVAL IN C# asp.net

查看:108
本文介绍了EVAL在C#中asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经放在绑定到一个DataSource对象一个DataList内容占位符的动态内容。问题是我需要检查EVAL的价值。这里是code:

i have dynamic content in a content placeholder placed in a datalist that is bound to an object datasource. the problem is i need to check the value of the EVAL. here is the code:

<asp:DataList ID="DataList1" runat="server" CellPadding="4" 
                DataSourceID="ObjectDataSource1" ForeColor="#333333">
                <AlternatingItemStyle BackColor="White" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <ItemStyle BackColor="#EFF3FB" />
                <ItemTemplate>


                    <a href="<%# Eval("VendorLink") %>"> <%# Eval("Vendor") %></a>
                    <br />
                    <a href="<%#    Eval("TitleLink") %> "><%# Eval("Title") %></a>
                    <br />
                    <asp:Label ID="DescLabel" runat="server" Text='<%# Eval("Desc") %>' />
                    <br />
                    <asp:Label ID="DetailsLabel" runat="server" Text='<%# Eval("Details") %>' />
                    <br />
                    <asp:Label ID="RptIDLabel" runat="server" Text='<%# Eval("RptID") %>' />
                    <br />

                    <asp:Label ID="LinksLabel" runat="server" Text='<%# Eval("Links") %>' />
                    <br />
                    <br />

                </ItemTemplate>
                <SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            </asp:DataList>

我想说

<%if(Eval("RptID") =="SomeString") { Eval("rtpid") = "Pass");}%>

我需要的检查是在aspx页面,而不是aspx.cs页面!如何进行检查?

i need the checkup to be at the aspx page and not the aspx.cs page! how to perform the checkup??

推荐答案

您可以检查象下面这样:

You can check like below :

<%# Eval("VenderLink") == "somestring" ? "p %>

这篇关于EVAL在C#中asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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