如何在gridView中包含内联服务器标记 [英] how to include inline server tags in a gridView

查看:61
本文介绍了如何在gridView中包含内联服务器标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



我有一个GridView有一个列包含0或1的位值。

我想显示这个词男性如果值为0则女性如果值为1则使用C#内联服务器标签。



谢谢

Hello

I have a GridView With a column contains a bit value of 0 or 1.
I want to show the word Male if the value is 0 and Female if the value is 1 using C# inline server tags.

Thank you

推荐答案

使用< %%>的嵌入式代码符号。
Its an embedded code using the <% %> symbols.


我想我理解(我可能错了)......

添加(如果是标签)......

< asp:label id =lblColumnValuetext = <%#DataBinder.Eval(Container.DataItem,DataBaseValue(defined))%> runat =serverxmlns:asp =#unknown>< / asp:label>
I "think" I understand (I might be wrong)...
Add(in case of a Label)...
<asp:label id="lblColumnValue" text=" <%# DataBinder.Eval (Container.DataItem, "DataBaseValue(defined)")%>" runat="server" xmlns:asp="#unknown"></asp:label>


你在谈论 <![CDATA [<%...%>]]> 块?

请参考以下链接:

嵌入式代码和内联服务器标签 [ ^ ]

ASP.NET内联服务器标签的快速参考 [ ^ ]





希望它有所帮助!

--Amit
Are you talking about <![CDATA[<% ... %>]]> blocks?
Refer the links below:
Embedded Code and Inline Server Tags[^]
A quick reference for the ASP.NET inline server tags[^]


Hope it helps!
--Amit


这篇关于如何在gridView中包含内联服务器标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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