您的位置:首页 > 移动开发 > Objective-C

在gridview中使具有特定值的链接不起作用

2011-08-11 17:50 141 查看
//前台

<asp:TemplateField HeaderText="更新">

   <HeaderStyle Font-Bold="False" Width="70px"></HeaderStyle>

      <ItemStyle HorizontalAlign="Center" />

        <ItemTemplate>

          <asp:HyperLink ID="lnkEdit" runat="server" Text="更新" Width="60" NavigateUrl='<%# "CustomerEdit.aspx?Id=" +Eval("Id")%>'>

          </asp:HyperLink>

        </ItemTemplate>

</asp:TemplateField>

 

//后台

/// <summary>

    /// 行绑定

    /// </summary>

    /// <param name="sender"></param>

    /// <param name="e"></param>

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)

    {

        if (e.Row.RowType == DataControlRowType.DataRow)

        {

            if (((System.Web.UI.WebControls.Label)e.Row.FindControl("lblID")).Text.ToString() == "")

            {

                ((HyperLink)e.Row.FindControl("lnkEdit")).Enabled = false;

            }

        }

    }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  hyperlink asp object server
相关文章推荐