?
Solved

VS.NET Design View query

Posted on 2006-04-03
1
Medium Priority
?
278 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:msiedle
1 Comment
 
LVL 5

Accepted Solution

by:
Darth_helge earned 2000 total points
ID: 16368023
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month15 days, 9 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question