저는 리 안에 div를 만드는 사이드 바 메뉴가 있습니다.ASP.NET if 문을 만드는 div
내가 가지고있는 문제는 메뉴의 항목이 활성화되어 있으면 비활성 div가 만들어지지 않아야한다는 것입니다. 예 : <li><div></div><div></div></li>
이 아니라 <li><div></div></li>
이어야합니다.
<xsl:if test="number(ParentEntityID) = 0 and EntityID!=$pCatID">
<div class="inactive">
<!--<a href="{concat('c-',EntityID,'-',SEName,'.aspx')}" style="color:black">-->
<xsl:choose>
<xsl:when test="count(child::Entity)=0">
<a href="{concat('c-',EntityID,'-',SEName,'.aspx')}" style="color:black">
<xsl:value-of select="$eName"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="EntityID=$ParentCategoryID">
<div class="active">
<xsl:value-of select="$eName"/>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$eName"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<!--</a>-->
</div>
</xsl:if>
그 출력 :
<li>
**<div class="inactive">**
<div class="active">
Active item
**</div>**
</div>
</li>
<li>
<div class="inactive">
Inactive item
</div>
</li>
비활성 사업부가 활성 사업부의 외부에서 만든되지 않으며, 비활성 상태입니다 만 작성해야하므로 위의 코드에서 무엇을 변경해야합니까? 나는 거기에 있으면 안되는 **에 줄을 넣었습니다.
나는 test="EntityID=$ParentCategoryID"
또는 if
문을 적절하게 배열하는 것과 관련이 있지만 그냥 알아낼 수 없다는 것을 알고 있습니다.
어떤 변수가 활성화되어 있는지 알려주는 변수는 무엇입니까? –
@ LenielMacaferi : 분명히 더 많은 코드가 있지만, 빈 클래스 div가 활성 클래스 div 외부에서 생성되는 것을 막는 일반적인 질문은 무엇입니까? '$ ParentCategoryID'는 활성화 된 것입니다. – Dave