慕無忌1623718
2018-10-10 05:06:15
使用gridview將oracle中的數(shù)據(jù)讀取出來 其中有兩列隱藏域?yàn)間uid數(shù)據(jù)類型想在想提取guid數(shù)據(jù)在后臺(tái)使用 獲取的值為system.byte[] 不為guid 前臺(tái)代碼<asp:HiddenField ID="HiddenOpGuid" runat="server" Visible="false" Value='<%# Eval("TRANSACTIONID").ToString() %>'></asp:HiddenField> 后臺(tái)代碼 protected void grvMonitor_RowDataBound(object sender, GridViewRowEventArgs e) { e.Row.Cells[0].Visible = true; HiddenField hidefield = (HiddenField)e.Row.Cells[0].FindControl("HiddenOpGuid"); e.Row.Cells[0].Visible = false; this.textbox.text=hidefield.value; }該如何解決
2 回答

忽然笑
TA貢獻(xiàn)1806條經(jīng)驗(yàn) 獲得超5個(gè)贊
<asp:TemplateField HeaderText="...">
<ItemTemplate>
<asp:Label ID="LabValue" runat="server" Text='<%# Eval("TRANSACTIONID").ToString() %>' Visible="False"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
//放一個(gè)隱藏的Label然后找到它,直接取它的Text不行嗎?
protected void grvMonitor_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label LabValue= (Label)e.Row.FindControl("LabValue");
//LabValue.Text =??
}
}
- 2 回答
- 0 關(guān)注
- 296 瀏覽
添加回答
舉報(bào)
0/150
提交
取消