如何通过Eval函数在QueryString中传递2个值? [英] How to Pass 2 Values in QueryString through Eval Function?
本文介绍了如何通过Eval函数在QueryString中传递2个值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我按照以下方式传递但错误显示
<a href =BoardStatement.aspx?eid =<%#Eval(MemberID )%>和Name =<%#Eval(BoardName)%>>详细信息
I Pass As Per Below But Error SHown
"<"a href="BoardStatement.aspx?eid=<%# Eval("MemberID") %> and Name=<%# Eval("BoardName") %>">Details
and Error is
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'BoardName'.
推荐答案
<a href='BoardStatement.aspx?eid=<%# Eval("MemberID")%>&Name=<%# Eval("BoardName") %>'>link text</a>
您提到的错误表示您的datarow没有列名BoardName的任何数据。请检查您是否从此列的数据库中获取了正确的数据。
error that you have mentioned means your datarow does not have any data for column name BoardName. please check if you get proper data from the database for this column.
<asp:repeater id="rpt" runat="server">
<itemtemplate>
<a href="BoardStatement.aspx?eid=<%# Eval(" memberid=") %>&Name=<%# Eval(" boardname=") %>">Details</a>
</itemtemplate>
</asp:repeater>
您可以像在转发器或任何其他DataBound控件中一样使用。
you can use like this inside repeater or any other DataBound control.
这篇关于如何通过Eval函数在QueryString中传递2个值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文