Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Writing style sheet code from a sub

Reply
Thread Tools

Writing style sheet code from a sub

 
 
=?Utf-8?B?S2VubmV0aCBQ?=
Guest
Posts: n/a
 
      01-17-2005
Hi,

I'm developing asp.net (vb) apps in VS.NET 2003, and I'd like to know how
you can write style sheet code in a sub in an .aspx page that when it's
rendered as html/text/css code in the .aspx page.

The idea is to programmatically write style sheet code that dynamically goes
into every page and is rendered accordingly.

Let's assume I wanted this kind of code into my rendered .aspx page

----------------------------------------------
<style type="text/css">
<!--
A.white11b { font-family: verdana,geneva,arial,helvetica; font-weight:
BOLD; font-size: 11px; color: #FFFFFF; text-decoration: none;}
A.white11b:visited { font-family: . . . .
----------------------------------------------------
But that this code doesn't exist before it's rendered.

How would I do that?

TIA

Kenneth P
 
Reply With Quote
 
 
 
 
MWells
Guest
Posts: n/a
 
      01-18-2005
There are two approaches.

One is to use a System.Web.UI.HtmlControls.HtmlGenericControl; using this,
along with a unique ID and runat=server on your <style> tag, you should be
able to write the contents programmatically.

Another approach is to write an ASPX page that generates the contents of a
full CSS file, mimed as text/css. Link this into your regular pages to make
use of it. This is useful for programmatically generating CSS "skins" from
database content.

/// M


"Kenneth P" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I'm developing asp.net (vb) apps in VS.NET 2003, and I'd like to know how
> you can write style sheet code in a sub in an .aspx page that when it's
> rendered as html/text/css code in the .aspx page.
>
> The idea is to programmatically write style sheet code that dynamically

goes
> into every page and is rendered accordingly.
>
> Let's assume I wanted this kind of code into my rendered .aspx page
>
> ----------------------------------------------
> <style type="text/css">
> <!--
> A.white11b { font-family: verdana,geneva,arial,helvetica; font-weight:
> BOLD; font-size: 11px; color: #FFFFFF; text-decoration: none;}
> A.white11b:visited { font-family: . . . .
> ----------------------------------------------------
> But that this code doesn't exist before it's rendered.
>
> How would I do that?
>
> TIA
>
> Kenneth P



 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2VubmV0aCBQ?=
Guest
Posts: n/a
 
      01-20-2005
Hi M,

> One is to use a System.Web.UI.HtmlControls.HtmlGenericControl; using this,
> along with a unique ID and runat=server on your <style> tag, you should be
> able to write the contents programmatically.


I've been using vs.net2002 & 2003 for about 4 years now, deployed a few
apps, butr I still lack experience of how to retrieve info about basic
classes in .net!

How can I in VS.NET 2003 see the methods and properties for
System.UI.HtmlControls.HtmlGenericControl?

> Another approach is to write an ASPX page that generates the contents of a
> full CSS file, mimed as text/css. Link this into your regular pages to make
> use of it. This is useful for programmatically generating CSS "skins" from
> database content.


A few questions on this.

The first sentence I understand, though I'm gonna need an example with code
on it.

The second sentence:
Hmmmm... Let me see. I think this is about sessions.
I should link it into my regular pages, you say. If there are many users
asking for the page at the same time, how will I resolve the conflict that
arises when I need to dynamically write a different .aspx file to each user
with css content? Or am I thinking wrong?

The third sentence:
I like the word "skins". That is absolutely the word I was thinking of when
I started to design my thoughts. But again, many users problem?

Regards,
Kenneth P

"MWells" wrote:

> There are two approaches.
>
> One is to use a System.Web.UI.HtmlControls.HtmlGenericControl; using this,
> along with a unique ID and runat=server on your <style> tag, you should be
> able to write the contents programmatically.
>
> Another approach is to write an ASPX page that generates the contents of a
> full CSS file, mimed as text/css. Link this into your regular pages to make
> use of it. This is useful for programmatically generating CSS "skins" from
> database content.
>
> /// M
>
>
> "Kenneth P" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi,
> >
> > I'm developing asp.net (vb) apps in VS.NET 2003, and I'd like to know how
> > you can write style sheet code in a sub in an .aspx page that when it's
> > rendered as html/text/css code in the .aspx page.
> >
> > The idea is to programmatically write style sheet code that dynamically

> goes
> > into every page and is rendered accordingly.
> >
> > Let's assume I wanted this kind of code into my rendered .aspx page
> >
> > ----------------------------------------------
> > <style type="text/css">
> > <!--
> > A.white11b { font-family: verdana,geneva,arial,helvetica; font-weight:
> > BOLD; font-size: 11px; color: #FFFFFF; text-decoration: none;}
> > A.white11b:visited { font-family: . . . .
> > ----------------------------------------------------
> > But that this code doesn't exist before it's rendered.
> >
> > How would I do that?
> >
> > TIA
> >
> > Kenneth P

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Death To Sub-Sub-Sub-Directories! Lawrence D'Oliveiro Java 92 05-20-2011 06:50 AM
Recognising Sub-Items and sub-sub items using xslt Ben XML 2 09-19-2007 09:35 AM
Content Page specific style style sheet rshillington@gmail.com ASP .Net 0 07-14-2006 03:45 PM
how to create a node set of elements through C++ code while executing a style sheet and process the created node set. pvssvikas@gmail.com XML 0 01-25-2006 12:48 PM
Tired of boring old datagrids... style sheet code anyone? Roy ASP .Net 1 08-10-2005 07:30 PM



Advertisments