Re: Web User Controls And StyleSheets

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: MLibby (mlibby_at_nospam.nospam)
Date: 07/02/04


Date: Fri, 2 Jul 2004 07:24:01 -0700

Hi Steven, Thank you for your reply!

I tried something interesting that is contrary to your response, "Yes, as for a html page, we have to link a css file in the <link > tag in the <head> area.":

When I link to a css file anywhere within a web user control (ascx) it works. css styles are aplied to the html in the ascx. The link is not in the .aspx page's head tags! This does NOT work on an aspx page.

Can you please verify this and let me know if this behavior is by design or will this css, .ascx implmentation break my code is some future release of visual studio?

Kind regards,
Mike

-- 
mcp, mcse, mcsd, mcad.net, mcsd.net
"Steven Cheng[MSFT]" wrote:
> Hi Mike,
> 
> Thanks for your response. To answer you the questions in the last reply:
> 1. Yes, as for a html page, we have to link a css file in the <link > tag 
> in the <head> area.
> 
> 2. Currently, there aren't any other means which can help modify the <head> 
> area without touching the aspx page template. Because we need to declare 
> the <head> area as  a serverside control so as to manipulate it in code 
> behind.
> 
> In addition, in asp.net we can set a Response Filter for a asp.net 's 
> Response object so as to hook its output result and do some modification. 
> Here are some tech articles on this:
> 
> #HOW TO: Archive the Results of a Dynamic Page to an HTML Page in ASP.NET 
> by Using Visual C# .NET
> http://support.microsoft.com/?id=810205
> 
> #Capturing the Output of ASP.NET Pages 
> http://weblogs.asp.net/despos/archive/2004/06/01/145436.aspx
> 
> 
> Regards,
> 
> Steven Cheng
> Microsoft Online Support
> 
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no 
> rights.)
> 
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
> 
> 


Relevant Pages

  • Re: Strange cell colours
    ... whether it is supposed to be HTML or XHTML. ... particular version of any particular browser would do with it. ... Which has no CSS, which is what you were complaining about. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: drop down
    ... concept of style information that can be separated from the html. ... A quick addition of some css to your table starts to make it take ... First tidy up would be to put all the styles in the head of your ...
    (alt.html)
  • Re: Css Ordered List problem FF and IE
    ... ok first of all stop using internal style sheets. ... copypasta all your css from your style.css document and make changes ...
    (alt.html)
  • Re: I need a consensus (HTML - CSS)
    ... I have been scratching my head all evening while reading and ... (The CSS is copied here for your convenience. ... Why are the font values not reflected in the html ... It should be in a separate document? ...
    (comp.infosystems.www.authoring.html)
  • Re: Embedded BODY style not working
    ... Windows 7 I get the correct colours for body and h1 using the CSS exactly as your snippet, ... FrontPage 4.0"> ... The linked stylesheet when produced by a FrontPage theme will _always_ be last in the section of the page - FrontPage will move it there regardless of your efforts, so the rules in this will override your rules. ...
    (microsoft.public.frontpage.client)