check property exists in template control

P

philip.poole

Hi everyone,

I am settings up some .NET controls on my website and want to create
template controls to completely separate the business layer and the
presentation layer.

However I have situations when I may extract up to 4 fields from the
database but not all four may be populated. Is there any way with my
ASP.net markup that I can check to see if the template field is not
null before attempting to write out any markup.

For example:

My plugin has 4 fields, a, b, c, d which I can access through
Container.a, Container.b etc.

I could write this out as:
<li><a href="Container.a"></li>

However I would want to check that Contain.a is not null before
writing out that markup.

Is this possible as I do not really want to write 4 different template
controls to do this due to database performance.

Thanks

Phil
 

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
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top