2个回答
展开全部
TemplateField LinkField = new TemplateField();
LinkField.ItemTemplate = new LinkURL2();
LinkField.HeaderText = "详细信息";
LinkField.ItemStyle.CssClass = "GridViewItemStyle";
LinkField.HeaderStyle.CssClass = "GridViewHeader1";
LinkField.ItemStyle.Width = System.Convert.ToInt32("60");
LinkField.ItemStyle.VerticalAlign = VerticalAlign.Middle;
LinkField.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
DG_Main.Columns.Add(LinkField);
public class LinkURL2 : ITemplate
{
public void InstantiateIn(Control container)
{
Label LabLink = new Label();
LabLink.ID = "LabLink";
LabLink.Text = "详细内容";
container.Controls.Add(LabLink);
}
}
绑定连接列,看你是不是用动态的
LinkField.ItemTemplate = new LinkURL2();
LinkField.HeaderText = "详细信息";
LinkField.ItemStyle.CssClass = "GridViewItemStyle";
LinkField.HeaderStyle.CssClass = "GridViewHeader1";
LinkField.ItemStyle.Width = System.Convert.ToInt32("60");
LinkField.ItemStyle.VerticalAlign = VerticalAlign.Middle;
LinkField.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
DG_Main.Columns.Add(LinkField);
public class LinkURL2 : ITemplate
{
public void InstantiateIn(Control container)
{
Label LabLink = new Label();
LabLink.ID = "LabLink";
LabLink.Text = "详细内容";
container.Controls.Add(LabLink);
}
}
绑定连接列,看你是不是用动态的
追问
呵呵,谢谢各位了,我已经将问题解决了,但是我还有个问题,就是我在后台和首页都有登录,两个页面的登录后台代码都一样,为什么后台可以等进去,首页就无法登进去呢?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询