GridView相关问题汇总
<asp:gridview id="gvData" runat="server" autogeneratecolumns="False">
??? <columns>
??????? <asp:templatefield headertext="所屬系統(tǒng)">
??????????? <itemtemplate>
??????????????? <asp:label id="lblPID" runat="server" text='<%# MyChange(Eval("PID").ToString()) %>'></asp:label>
??????????? </itemtemplate>
??????? </asp:templatefield>
??????? <asp:templatefield headertext="問(wèn)題">
??????????? <itemtemplate>
??????????????? <asp:hyperlink id="hylTitle" runat="server" text='<%# Eval("Title") %>' navigateurl='<%# "~/UserShowDetail.aspx?qid=" +? Eval("QID") %>'></asp:hyperlink>
??????????? </itemtemplate>
??????? </asp:templatefield>?
??? </columns>
</asp:gridview>
protected string MyChange(string strPID)
{
??? string strTemp = strPID.Substring(0, 1);
??? if (strTemp == "1")
??? {
??????? return "一級(jí)建造師";
??? }
??? else
??? {
??????? return "二級(jí)建造師";
??? }
}
轉(zhuǎn)載于:https://www.cnblogs.com/miclu/archive/2007/06/21/791964.html
總結(jié)
以上是生活随笔為你收集整理的GridView相关问题汇总的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 聚宝盆,只要你上网就可以挣钱
- 下一篇: [JavaScript] 正则表达式