Link to home
Start Free TrialLog in
Avatar of Robb Hill
Robb HillFlag for United States of America

asked on

hiding a div tag - not working

I have the following code.  It is some to hide a div based on a value in my model...but it seems to hide it all the time...something must be wrong with the syntax.

Here is the code:
  <div class="step-content">
                                            <div class="@(Model.SiteName.Contains("subscribersite_")?"hidden":"step-pane active sample-pane alert")" data-step"1">

Open in new window


This should only hide the dive tag when the model contains that value.  It does hide it...but it also hides it when it doesnt contain that value.


I am using built in bootstrap to change the class...but a display none approach is fine as well.


Thanks
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Is this a problem of the page not rendering out the correct class
OR
The class not doing what it is supposed to do i.e. hide the div

In other words if SiteName contains subscribersite_ do you get this
<div class="hidden" data-step="1">

Open in new window

And if SiteName DOES NOT contain subscribersite_ do you get this
<div class="step-pane active sample-pane alert" data-step="1">

Open in new window


Are we dealing with a server side logic issue or a client side styling issue?
Avatar of Robb Hill

ASKER

when i render the html it indicates
<div class="hidden" data-step="1">

which is the html it should render since it does not contain subscribersite_

yet it still hides the div...

It hides div no matter what
ASKER CERTIFIED SOLUTION
Avatar of NerdsOfTech
NerdsOfTech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial