Saturday 15 June 2013

asp.net mvc - Condition in a class in razor -


How a condition works in a razor, I have the following code, but it does not work.

  & lt; Span id = "tab1" class = "@ TempData [" CurrentTab "] == 'Tab 1'? 'List Tag Active Tag': 'List Tag' & gt; @ MyAccountRes.VTxt_BasicInformation & lt; / Span & gt; & Lt; Span id = "tab2" class = "@ TempData [" CurrentTab "] == 'Tab2'? 'List Tag Active Tag': 'List Tag'" & gt; @ MyAccountRes.VTxt_DetailInformation & lt; / Span & gt; & Lt; Span id = "tab3" class = "@ TempData [" CurrentTab "] == 'Tab 3'? 'List Tag Active Tag': 'List Tag'" & gt; @MyyCountryRes.Victit IconManagment & lt; / Span & gt; & Lt; Span id = "tab4" class = "@ TempData [" CurrentTab "] == 'Tab4'? 'ListTag Active Tag': 'List Tag' & gt; @ MyAccountRes.VTxt_EducationInfomation & lt; / Span & gt; & Lt; Span id = "tab5" class = "@ TempData [" CurrentTab "] == 'Tab 5'? 'List Tag Active Tag': 'List Tag' & gt; @ MyAccountRes.VTxt_JobInfomation & lt; / span & gt;   

-product "itemprop =" text ">

try it < / P>

  & lt; Span id = "tab1" class = "@ (TempData [" CurrentTab "] ==" Tab 1 "?" ListTag ActiveTag ":" ListTag ")" & gt; @ MyAccountRes.VTxt_BasicInformation & lt; / Span & gt;    

No comments:

Post a Comment