Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / September 2005

Tip: Looking for answers? Try searching our database.

stylesheet with Body TopMargin screws up designer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tim_Mac - 20 Sep 2005 18:21 GMT
hi,
i have run into a frustrating problem with the way VS handles
stylesheets.  i link to a stylesheet, that contains among other items a
top-margin value.  unfortuantely visual studio applies this top margin
to every control on the page, buttons, datalists etc.  it makes the
page very difficult to work with in the designer.  to reproduce the
situation, create a style sheet and aspx page as below

style sheet contents:
Body
{
    margin-top: 230px
}

aspx page contents:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    <HEAD>
        <title>WebForm1</title>
        <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
        <meta name="CODE_LANGUAGE" Content="C#">
        <meta name="vs_defaultClientScript" content="JavaScript">
        <meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
        <link rel="stylesheet" href="styles.css" type="text/css">
        </HEAD>
    <body>
        <form id="Form1" method="post" runat="server">
            <asp:Button id="Button1" runat="server" Text="Button"></asp:Button>
        </form>
    </body>
</HTML>

then preview the aspx page and you should see what i mean.
surely this is a big bug?  i know you can set topmargin attribute in
the body tag, but i'm doing all that in CSS if possible.

thanks for any tips
tim
"Gary Chang[MSFT]" - 21 Sep 2005 06:55 GMT
Hi Tim,

>i have run into a frustrating problem with the way VS handles
>stylesheets.

I have tested the sample webpage(with the stylesheet) in VS2003 IDE, IE,
even the FireFox browser, the top margin will be applied to every control
on the page in all of the above testing scenario. So it appears not a
VS.NET IDE problem, it mab be an expected behavior in this case.

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Tim_Mac - 21 Sep 2005 11:45 GMT
hi Gary,
i don't know how you can see that.  when i test the page in IE6 sp2,
and Firefox 1.0.6 on win xp sp2, the margin is correctly applied only
to the body element. the button controls do not apply a top margin.  so
all the browsers i can try display the page correctly.  the problem is
only in the IDE as far as i can make out.
i even tried it on IE 5 out of the box windows 2000 and it renders
correctly.  so i would like you to re-check your test scenario.  i am
including an extended html document below which contains a few more
controls to emphasise the point.
thanks
tim

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    <HEAD>
        <title>WebForm1</title>
        <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
        <meta name="CODE_LANGUAGE" Content="C#">
        <meta name="vs_defaultClientScript" content="JavaScript">
        <meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
        <link rel="stylesheet" href="styles.css" type="text/css">
    </HEAD>
    <body>
        <form id="Form1" method="post" runat="server">
            <P>
                <asp:Button id="Button1" runat="server"
Text="Button"></asp:Button></P>
            <P>
                <asp:CheckBox id="CheckBox1" runat="server"></asp:CheckBox></P>
            <P>
                <asp:LinkButton id="LinkButton1"
runat="server">LinkButton</asp:LinkButton></P>
        </form>
    </body>
</HTML>
Steven Cheng[MSFT] - 22 Sep 2005 07:44 GMT
Hi Tim_Mac,

Based on some further tests, I managed to reproduce the behavior you
mentioned in VS.NET 2003 ide, yes the css style seems apply to all the
control drag onto it in design-view. I think this should be a big issue of
the VS.NET IDE.   Also, this problem is addressed by our dev guys together
with the other existing issues of the VS.NET IDE's design-time view for web
page development (such as the unexpected auto html formatting...) since
I've also tested them in the current BETA2 version of the VS.NET whidbey
IDE. Anyway, sorry for any incovenience it brings you in the current
ASP.NET 1.X development.

Thanks,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "Tim_Mac" <tim@mackey.ie>
| Newsgroups: microsoft.public.vsnet.general
[quoted text clipped - 9 lines]
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1127299506 17516 127.0.0.1 (21 Sep 2005
10:45:06 GMT)
| X-Complaints-To: groups-abuse@google.com
| NNTP-Posting-Date: Wed, 21 Sep 2005 10:45:06 +0000 (UTC)
| In-Reply-To: <N0bkfEnvFHA.768@TK2MSFTNGXA01.phx.gbl>
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7.10) Gecko/20050716 Firefox/1.0.6,gzip(gfe),gzip(gfe)
| Complaints-To: groups-abuse@google.com
| Injection-Info: g49g2000cwa.googlegroups.com; posting-host=83.141.121.205;
|    posting-account=UaxKfw0AAAA4oMLJHydK195yIv1avAma
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!ne
wsfeed1.ip.tiscali.net!news.glorb.com!postnews.google.com!g49g2000cwa.google
groups.com!not-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.vsnet.general:10527
| X-Tomcat-NG: microsoft.public.vsnet.general
[quoted text clipped - 36 lines]
|     </body>
| </HTML>
Tim_Mac - 22 Sep 2005 15:56 GMT
hi Steven,
glad to know it is being worked on.  i really hope it doesn't carry
through to whidbey final release.
thanks
tim
Steven Cheng[MSFT] - 23 Sep 2005 03:17 GMT
Thanks for your response Tim,

Yes, from the VS.NET2002 til the comming Whidbey, our dev guys are
struggling with those existing limitations and known issues for ASP.NET
design-time so as to improve the design-time experience. I'm sure the R&D
environment will be getting better and better though there may still exists
some issues withit. But we're really making it better and better everday.  
Also, thanks a lot for your sincere feedback since our dev guys and other
product analysis always think the suggestions and feedback from community
and our customers are our invaluable resources and fortune.

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "Tim_Mac" <tim@mackey.ie>
| Newsgroups: microsoft.public.vsnet.general
[quoted text clipped - 10 lines]
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1127401018 23678 127.0.0.1 (22 Sep 2005
14:56:58 GMT)
| X-Complaints-To: groups-abuse@google.com
| NNTP-Posting-Date: Thu, 22 Sep 2005 14:56:58 +0000 (UTC)
| In-Reply-To: <IUwxUE0vFHA.768@TK2MSFTNGXA01.phx.gbl>
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7.10) Gecko/20050716 Firefox/1.0.6,gzip(gfe),gzip(gfe)
| Complaints-To: groups-abuse@google.com
| Injection-Info: g14g2000cwa.googlegroups.com; posting-host=83.141.121.205;
|    posting-account=UaxKfw0AAAA4oMLJHydK195yIv1avAma
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!ne
wsfeed1.ip.tiscali.net!news.glorb.com!postnews.google.com!g14g2000cwa.google
groups.com!not-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.vsnet.general:10561
| X-Tomcat-NG: microsoft.public.vsnet.general
[quoted text clipped - 4 lines]
| thanks
| tim

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.