[英]using Eval in vb.net
hiii everyone.... 大家好...
i have small problem with my code in vb.net that i want to use (Eval) in my project 我在vb.net中的代码中有一个小问题,我想在项目中使用(Eval)
so i write this code : 所以我写这段代码:
<asp:Label ID="Label1" runat="server"
Text='<%#Eval("PAG_PAGES") == null ? "" : ((PostAgenciesModel.PAG_PAGES)(Eval("PAG_PAGES"))).PAGE_TITLE_AR %>' />
and this code i used in my C# project .... all want to show the (Label1) in inside my GridView.... 而我在C#项目中使用的这段代码....所有人都想在GridView中显示(Label1)。
("PAG_PAGES")
is the name of table.. ("PAG_PAGES")
是表的名称。
PostAgenciesModel
is the edmx
... PostAgenciesModel
是edmx
...
PAGE_TITLE_AR
is the colum in ("PAG_PAGES")
that i want to show it PAGE_TITLE_AR
是我要向其显示的("PAG_PAGES")
中的列
can anyone help plzzz 谁能帮忙
thanxx thanxx
<%# If(Eval("PAG_PAGES") Is Nothing,
"",
DirectCast(Eval("PAG_PAGES"), PostAgenciesModel.PAG_PAGES).PAGE_TITLE_AR) %>
Elaborating on what Oded wrote: 详细介绍奥德写的内容:
expr == null ---> expr Is Nothing
a ? b : c ---> If(a, b, c)
(Type)expr ---> DirectCast(expr, Type)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.