Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default stylesheet question

    Can anybody tell me how the ascx pages know which stylesheet it should use
    in ASP.NET Community Stqarter Kit. Previously the stylesheet page was
    explicitly referenced in the html or asp page which used it.

    Regards
    Uli


    Uli Guest

  2. Similar Questions and Discussions

    1. Dynamically adding a stylesheet
      I want to dynamically add a stylesheet using <style type="text/css"></style> tags. The code that will use this stylesheet will be shared, so I will...
    2. Linking a stylesheet...
      Heya, I am trying to link a stylesheet to a file that is in another folder, I tried entering the url in the 'link ref' but it still wouldn't find...
    3. StyleSheet reset
      Okay, I have a search result page with a query output and pagination. I need to find a way to reset the visited links back to blue from red when...
    4. mod_perl + stylesheet
      Hi, Could anyone tell me how I can include a stylesheet in the perl code in a mod_perl script. TIA Vincent for example: use strict; my $r...
    5. Warning when saving stylesheet
      Hi, Lately when I edit a style sheet, then go to save it, I get the following warning message: "Unable to launch. Please be sure that the...
  3. #2

    Default Re: Stylesheet question

    Samukl van Laere wrote in alt.html:
    > Hello David,
    >
    > This is the code as it was published by Toby:
    > ============================ example.php =============================
    > <!DOCTYPE whatever>
    > <?php
    > $s = $_GET['style'];
    > if (!($s)) { $s = 'red'; }
    > ?>
    > <html>
    > <head>
    > <title>Example</title>
    > <link rel="stylesheet" type="text/css" media="screen,projection"
    > <?php echo ' href="styles/' . $s . '.css"'; ?> >
    > </head>
    > <body>
    > <h1>Example</h1>
    > <p>The style you chose was <code><?php echo $s ?>.css</code>.</p>
    > <ul>
    > <li><a href="example.org?style=red">Red</a></li>
    > <li><a href="example.org?style=white">White</a></li>
    > <li><a href="example.org?style=black">Black</a></li>
    > </ul>
    > </body>
    > </html>
    > ================================================== ====================
    One might note that there's a potential security issue with allowing
    the user to put anything they want in the $s variable. A more robust
    script might look like

    <?php
    $styletag = $_REQUEST['s']; // explicit import
    $stylesheet = "default.css";

    // map style tags to actual stylesheets
    if ($styletag == 'red')
    $stylesheet = "red.css";
    elseif ($styletag == 'white')
    $styletag = "white.css";
    elseif ($styletag == 'black')
    $styletag = "black.css";

    // Use php echo stylemap('/foo/bar.php'); for all links that should
    // propagate style information
    function stylemap ($url) {
    global $styletag;
    return $url . "?s=" . $styletag;
    }

    .....the rest of your script....
    ?>
    <!DOCTYPE ...>
    <html>
    <head>
    <title>Page Title</title>
    <link rel="stylesheet" type="text/css" href="<?php echo $stylesheet;
    ?>">
    <link rel="alternate stylesheet" ...alternate stylesheet links...>
    </head>
    .....the rest of your page....

    <a href="<?php echo stylemap('links.php'); ?>">links</a> (for example)

    All code untested and written off the cuff
    Owen Jacobson Guest

  4. #3

    Default Re: Stylesheet question

    Owen Jacobson wrote:
    > Samukl van Laere wrote in alt.html:
    >> Hello David,
    >> This is the code as it was published by Toby:
    >> ============================ example.php =============================
    >> <!DOCTYPE whatever>
    >> <?php
    >> $s = $_GET['style'];
    >> if (!($s)) { $s = 'red'; }
    >> ?>
    [snip]
    >> <link rel="stylesheet" type="text/css" media="screen,projection"
    >> <?php echo ' href="styles/' . $s . '.css"'; ?> >
    [snip]
    > One might note that there's a potential security issue with allowing
    > the user to put anything they want in the $s variable.
    There is no security issue. So what if the user puts something odd in $s?
    It's not like I did an "include($s)".

    [newsgroups set back to include alt.html, as I don't read comp.lang.php --
    PHP sucks]

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - [url]http://www.goddamn.co.uk/tobyink/?id=132[/url]

    Toby A Inkster Guest

  5. #4

    Default Re: Stylesheet question

    Toby A Inkster <UseTheAddressInMySig@deadspam.com> wrote in message news:<pan.2003.11.04.19.19.10.489914@goddamn.co.uk >...

    <snip>
    > [newsgroups set back to include alt.html, as I don't read comp.lang.php --
    > PHP sucks]
    Then why stay here? Just get lost out of PHP.

    ---
    "If there is a God, he must be a sadist!"
    Email: rrjanbiah-at-Y!com
    R. Rajesh Jeba Anbiah Guest

  6. #5

    Default stylesheet question

    how to apply a stylesheet for the entire web applciation in ASP.NET?

    Thanks


    Nedu N Guest

  7. #6

    Default Re: stylesheet question

    If the site is already built, you have to link page by page. If you are
    planning, you can make templates of the page with the stylesheet thrown in.
    You can also subclass the Page class and include the stylesheet. But, this
    makes for quite a bit of work after a site is already built. I know of no
    way to apply across the entire web easily, although it would be a nice
    add-in for VS.NET.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    ************************************************** ********************
    Think Outside the Box!
    ************************************************** ********************
    "Nedu N" <nedu_n@hotmail.com> wrote in message
    news:unMm5e0vDHA.556@TK2MSFTNGP11.phx.gbl...
    > how to apply a stylesheet for the entire web applciation in ASP.NET?
    >
    > Thanks
    >
    >

    Cowboy \(Gregory A. Beamer\) Guest

  8. #7

    Default RE: stylesheet question

    Hi Nedu,

    I noticed that you posted the same question in the
    microsoft.public.dotnet.framework.aspnet group. I have replied you on that
    thread. Please check it when you have time.

    Best regards,

    Jacob Yang
    Microsoft Online Partner Support
    Get Secure! ¨C [url]www.microsoft.com/security[/url]
    This posting is provided "as is" with no warranties and confers no rights.

    Jacob Yang [MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139