需要帮助的详细视图 [英] Help needed in detail view
本文介绍了需要帮助的详细视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
下面是我的详细视图的aspx代码
Hi
Below is my aspx code for detail view
<asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="554px" AutoGenerateRows="False" BackColor="White" Visible="false" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" CellPadding="4" GridLines="Horizontal" > <pagerstyle backcolor="#336666" forecolor="White" horizontalalign="Center" />
<asp:TemplateField HeaderText="Company Name"> <asp:Label ID="complbl" runat = "server" text=''<%# Eval("CompName")%>''>
<asp:TemplateField HeaderText="Company Address"> <asp:Label ID="addlbl" runat="server" Visible="true" text=''<%# Eval("CompAdd")%>''>
<HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
当我运行此代码条件变为假
请纠正我我该怎么做.
When i run this code condition is becoming false
Please correct me what i have to do.
if(DetailsView1.Rows.Count != 0)
{
Label compname = (Label)DetailsView1.Rows[1].Celles[0].FindControl("complbl");
}
谢谢
Thanks
推荐答案
hi
而不是使用此
hi
instead of use this
if(DetailsView1.Rows.Count != 0)
{
Label compname = (Label)DetailsView1.Rows[1].Celles[0].FindControl("complbl");
}
使用以下
use the following
if(DetailsView1.Rows.Count != 0)
{
Label compname = (Label)DetailsView1.Rows[1].FindControl("complbl");
}
这篇关于需要帮助的详细视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文