I think i'm going mad here. It still does not work!
I set a breakpoint and what i am checking for is correct. I have tested with the code below:-
if (String.IsNullOrEmpty(dbReader["tab_3"].ToString()))
{
Label1.Text = "<li><a href=#fragment-10><span>" + dbReader["tab_1"].ToString() + "</span></a></li>";
}
else
{
Label1.Text = "<li><a href=#fragment-10><span>" + dbReader["tab_1"].ToString() + "</span></a></li>" +
"<li><a href=#fragment-11><span>" + dbReader["tab_3"].ToString() + "</span></a></li>";
}What happens is that the IF is totally ignored and the ELSE is executed. Therefore i am left with 2 tabs one of them which empty. Let me explain the logic. This is what my label will look like if all the database tab field have a value:-
Label1.Text = "<li><a href=#fragment-10><span>" + dbReader["tab_1"].ToString() + "</span></a></li>" +
"<li><a href=#fragment-11><span>" + dbReader["tab_2"].ToString() + "</span></a></li>" +
"<li><a href=#fragment-12><span>" + dbReader["tab_3"].ToString() + "</span></a></li>" +
"<li><a href=#fragment-13><span>" + dbReader["tab_4"].ToString() + "</span></a></li>";Now the IF statement should simply be checking if tab_1 contains nothing then write tab_2, tab_3, and tab_4 to the label and vice versa.
I have done this before many times and have never had a problem. However i did once try writing and it worked but that does not work either.
What i want to do with the first bit of code is say if the database row tab_3 is empty then ONLY write tab_1 to the label OTHERWISE write tab_1 AND tab_3..
Maybe i'm missing something out, but can anyone offer any advice..
Thanks