Set Date Visible condition in LinkButton

后端 未结 1 330
灰色年华
灰色年华 2021-01-25 04:13

Set Date Visible condition in LinkButton Using ASP.NET C# Web Forms. I have a GridView. In GridView Template field using

相关标签:
1条回答
  • 2021-01-25 04:36

    Use this:

    In ASPX:

    Visible='<%#GetVisible(Eval("BatchDate").ToString())%>'
    

    And in the code behind:

    public bool GetVisible(object value)
    {
        if (Convert.ToDateTime(value) <= DateTime.Now)
        {
            return true;
        }
        return false;
    }
    
    0 讨论(0)
提交回复
热议问题