I work with Umbraco and am not familiar to kentico. But now at work i have to fix something for another website.in the page, they want an a tag do nothing if there is no link, meaning doesn't open another page or anything else. I found the code and it's in document type, an ASCX file. I just need to put a condition that if there is nothing under the link, then do nothing. but the problem is this if statement doesn't work. I have change it to different formats but it doesn't realise the link is empty.
Does anyone know if there is another kind of if statement or condition which will recognise the empty field?
If this is for Kentico probably best on their forums... but I think the problem you are having is that you are binding the Eval("URL") statement - i.e. with the <%# %> brackets but also attempting to read it as presumably the property of the page - in the first line. I'm guessing now as to how Kentico works, but thinking back to when I used web forms, this type of thing is best done in the code behind, in an "ItemDataBound" event.
Thanks Andy. I think you are right about putting the statement in the code behind, in ItemDataBound event. but i am not sure where it is.
I submitted my question in kentico forum. let's see if i'll get any answer.
if else Statement
Hello,
I work with Umbraco and am not familiar to kentico. But now at work i have to fix something for another website.in the page, they want an a tag do nothing if there is no link, meaning doesn't open another page or anything else. I found the code and it's in document type, an ASCX file. I just need to put a condition that if there is nothing under the link, then do nothing. but the problem is this if statement doesn't work. I have change it to different formats but it doesn't realise the link is empty.
Does anyone know if there is another kind of if statement or condition which will recognise the empty field?
If this is for Kentico probably best on their forums... but I think the problem you are having is that you are binding the Eval("URL") statement - i.e. with the <%# %> brackets but also attempting to read it as presumably the property of the page - in the first line. I'm guessing now as to how Kentico works, but thinking back to when I used web forms, this type of thing is best done in the code behind, in an "ItemDataBound" event.
Andy
Thanks Andy. I think you are right about putting the statement in the code behind, in ItemDataBound event. but i am not sure where it is. I submitted my question in kentico forum. let's see if i'll get any answer.
Thanks a lot anyway.
regards, Mitra
is working on a reply...