c#里面绑定后进行判断
<asp:GridView ID= "GridView1 " runat= "server " AutoGenerateColumns= "False " UseAccessibleHeader= "False " GridLines= "None " Width= "100% ">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<div id= "searchview ">
<div id= "jgt ">
<img src= " " width= "80px " height= "80px "/>
</div>
<div id= "jgz ">
[ <%# Eval( "acti_cp_xz ")%> ]
<%# Eval( "acti_cp_name ")%> </div>
<div id= "jgzw "> </div>
<div id= "jgj "> <%# Eval( "acti_jg ") %> </div>
<div id= "jgcity "> <%# Eval( "acti_city ")%> </div>
剩余 <%# Eval( "acti_cp_ydate ")%> 天
</div>
</div>
</li>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
进行绑定后进行判断
如 Eval( "acti_cp_xz ") 显示后 1 2 3 判断出1为出售 2为出租
在问一下.如何进行 绑定后的时间运算 如 2006-12-8 - 2006-12-1 剩余7天
本人刚学.请高手指教
------解决方案-------------------- <%# GetType(Eval( "acti_cp_xz ").ToString())%>
后始
protected string GetType(strType)
{
switch(strType)
{
case "1 ":
return "出售 ";
case "2 ":
return "出租 ";
default:
return "其他 ";
}
}