If ... Then .... Else .... Simple But Trouble

Joined
Nov 20, 2008
Messages
1
Reaction score
0
Hi , all

I've been using If .. Then .. Else Clause for thousand time but maybe i'm new in ASP.NET

Please see code below.

Code:
<% If Not (String.IsNullOrEmpty(ShareDB.Tables(0).Rows(0).Item("Modified_By_ID").ToString)) Then%>
<u>Modified By</u> : <%#FetchDB("User_FullName", "Company_User", "User_ID = " & Eval("Modified_By_ID"))%><br />
<u>Modified At</u> : <%#Eval("Reserved_At")%>
<% End If%>

I did double check the "String.IsNullOrEmpty(ShareDB.Tables(0).Rows(0).Item("Modified_By_ID").ToString" .... It gave me True.

Because of "Not" in front of "String.IsNullOrEmpty(ShareDB.Tables(0).Rows(0).Item("Modified_By_ID").ToString" ... so the result will be "False".

If the Condition return false .... things under Then .... End If must not be display , am I right ?

But my problem is it's displayed ( which not supposed to )

Can somebody explain me this ?
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top