CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: Date Entered: 9/10/2003 6:01:11 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 4 Views: 106 Favorited: 0 Favorite
5 Items, 1 Pages 1 |< << Go >> >|
"morkovkin" <>
NewsGroup User
Dynamically assign CSS link to a page9/10/2003 6:01:11 PM

0

Guys, need your help.
I'm trying to put <LINK rel='stylesheet' href='include/main.css' type='text/css'> to head section dynamically from webcontrol that uses i'ts specific stylesheet.
Does anyone knows how can i implement this?
I was trying different methods but all of them failed. Also I need to add script block into a head section. Any ideas?
"btanner" <>
NewsGroup User
Re: Dynamically assign CSS link to a page9/10/2003 6:23:27 PM

0

This article may help - http://www.aspalliance.com/graymad/BrowseCapUC.aspx
Brad Tanner

Principal Solutions Architect

Strategic Technologies, Inc.

6601 Southpoint Dr. N., Suite 200

Jacksonville, FL 32216

Email: [email protected]
"ditlevsen" <>
NewsGroup User
Re: Dynamically assign CSS link to a page9/10/2003 8:54:17 PM

0

Add this to the head:
<link id="LinkCss" runat="server" type="text/css" rel="stylesheet"/>

Add this this C# code to your class:
protected System.Web.UI.HtmlControls.HtmlGenericControl LinkCss;

and use this code to change the attribute href
LinkCss.Attributes["href"] = "include/main.css";

the .Net way to add script blocks to the page is by use of RegisterClientScriptBlock(string key, string script).

it will add the script just after the viewstate in the HTML


"morkovkin" <>
NewsGroup User
Re: Dynamically assign CSS link to a page9/11/2003 8:48:17 AM

0

Add this to the head:
<link id="LinkCss" runat="server" type="text/css" rel="stylesheet"/>

That doesn't resolve the problem. I want these tags to be added into "head" automatically without knowing what ASPX page is used.
1) I Have aspx page with my control.
2) Page runs, webcontrol renders and automatically adds LINK and SCRIPT tags into HEAD section of an HTML.

Any variants?
There was an idea to use this technic:

Page.Controls.AddAt(1, new LiteralControl("<LINK rel='stylesheet' href='include/main.css' type='text/css'>"));

But this code only adds specified tag at the very end of a page.
"ldarcy" <>
NewsGroup User
Re: Dynamically assign CSS link to a page9/15/2003 1:15:09 AM

0

Why you just don't insert

output.AddAttribute("rel", "styleSheet");
output.AddAttribute(HtmlTextWriterAttribute.Href, "include/main.css");
output.RenderBeginTag(HtmlTextWriterTag.Link);
output.RenderEndTag();

in your component's Render? Yes, the LINK gets inserted in the middle of page, where the control is rendered. not in the HEAD section. And yes, it still works.
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:













asp.net 2.0 - azman - (form + ad) -role based authentication - confusion

can i know the client machine's login id

simple login control question

not able to update membership.isapproved

role based forms authentication

medium trust + reflection.emit

userid's that contain letters

help needed to check 2 usernames to proceed.

logging out after changing the password

formauthentication godaddy

extracting and displaying roles and membership data

access denied for file access

preventing multiple login using same username/password

accessing session state from authorizerequest handler

roles

a beginner in asp.net need help

authentication forms problems

login control, validating the user and re-directing

authentication for subdirectoris pages

launch external program with different user...

role authorization - is there any way to redirect to a page other than the forms logon page for access denied or display a access denied message on the forms logon page?

roles question

can't login to actual website (club starter kit)

forms authentication issue

mixed authentification - win and forms

web forms authentication....

controls generate html code...

maintaining asp.net memebership information

aspnet_users userid :( windows authentication

singleton implementation for shopping cart

membership/profile problem

problem with asp.net forms authentication

changepassword control and raising the changepassworderror

mix form and windows security? (doable?)

server error in '/' application problem

can i verify a certificate without installing the root an intermediate certifiacte?

need to run script under admin

relation between web.config and the providers

forms autentication and roles (.net 1.1)

login status control/login name control

createuserwizard sendingemail substitution problem

membershipprovider ignores initialize method

role based security based on windows authentication

membership api

login not working on host, works in development

membership.changepassword()

what if my application startup page is different from the login page

simple authentication question

help in extending the login control?

separate login page for mobile support using forms authentication

   
  Privacy | Contact Us
All Times Are GMT