更新时间:2023-02-05 15:03:57
结果与预期相反,因为if条件错误。
只需在条件中添加而不是
,它应该按预期工作。
The result is opposite than the expected because the if condition is wrong.
Just add anot
to the condition and it should work as expected.
if (!String.IsNullOrEmpty(myDataRowView["Signout_Time"].ToString()))
{
//rest of code
如果不是,请告诉我。有帮助:)
Please let me know, if it doesn't helps :)
我发现了另一种更简单的方法emTemplae。这就是我做的事情
I have discovered another easier way of doing it in my ItemTemplae. this is what i did
<pre lang="ASP.NET"><asp:Button Visible='<%# string.IsNullOrEmpty(Eval("Signout_Time").ToString()) %>' runat="server" Text="Sign out" ID="out" CommandName="SignOut" CommandArgument='<%#Eval("SN") %>'/>
这也是神奇的。两种解决方案都很完美
This also did the magic. Both solutions are perfect