Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Uli #1
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
-
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... -
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... -
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... -
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... -
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... -
Owen Jacobson #2
Re: Stylesheet question
Samukl van Laere wrote in alt.html:
One might note that there's a potential security issue with allowing> 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>
> ================================================== ====================
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
-
Toby A Inkster #3
Re: Stylesheet question
Owen Jacobson wrote:
[snip]> 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"'; ?> >There is no security issue. So what if the user puts something odd in $s?> One might note that there's a potential security issue with allowing
> the user to put anything they want in the $s variable.
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
-
R. Rajesh Jeba Anbiah #4
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>
Then why stay here? Just get lost out of PHP.> [newsgroups set back to include alt.html, as I don't read comp.lang.php --
> PHP sucks]
---
"If there is a God, he must be a sadist!"
Email: rrjanbiah-at-Y!com
R. Rajesh Jeba Anbiah Guest
-
Nedu N #5
stylesheet question
how to apply a stylesheet for the entire web applciation in ASP.NET?
Thanks
Nedu N Guest
-
Cowboy \(Gregory A. Beamer\) #6
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
-
Jacob Yang [MSFT] #7
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



Reply With Quote

