views:

45

answers:

1

Hi,

I have a code chunck below that is being output with a space in the element when it's formated as shown and the condition is false. If I put it on one line it generates the required output. What I'm after is a more elegant solution. Any ideas?

Code Formated:

        <ul class="drop-menu-top dropdown-menu">
        <% if (propertyClass == PropertyClass.Overseas) { %>
            <% Html.RenderPartial("Menus/OverseasPrimaryNav"); %>
        <% } %>
        </ul>

Output:

        <ul class="drop-menu-top dropdown-menu"> </ul>

Required Output:

        <ul class="drop-menu-top dropdown-menu" />

or

        <ul class="drop-menu-top dropdown-menu"></ul>

Thanks,

Denis

A: 

Have you tried:

<ul class="drop-menu-top dropdown-menu"><% 
   if (propertyClass == PropertyClass.Overseas) { %>
            <% Html.RenderPartial("Menus/OverseasPrimaryNav"); %>
<% } %></ul>
eglasius
Is there any elegant solution rather than this ?
Barbaros Alp