VS.NET Design View query

Hi all

We recently made a change to our page design and were required to add this to our ASP.NET to determine which css div tag was used:

                        <%
                        If Session("show_Right_Panel") = True Then
                        %>
                        <div id="main">
                        <%
                        Else
                        %>
                        <div id="main_wide">
                        <%
                        End If
                        %>

...which works great in the live environment, but in Visual Studio 2003 design view, it appears to be ignoring the If Else statement and just adding both div tags ...hence the design looks all screwed up

Eg. If I do this everything is fine:

                        <%
                        If Session("show_Right_Panel") = True Then
                        %>
                        <div id="main">
                        <%
                        End If
                        %>

...it just doesn't handle the Else ...hence my reason for thinking it is ignoring the If Else

Does anyone know a way to fix this, or get VS to see If Else statements and choose the div tag accordingly?

Thanks
Mark
LVL 2
msiedleAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Darth_helgeCommented:
You don't have any session variables in design time, so this can be difficult. You can determine whether you are in design time or not by checking the site variable which is nothing at runtime, but nonetheless: The design view cannot choose one div tag for you.

You could create a cutom control with your div tag and add a property to that control which determines which design to use. Only in this way you can get the design view to understand what youre doing
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.