Print Page | Close Window

Web User Controls problem???

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=23365
Printed Date: 28 March 2026 at 2:20pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Web User Controls problem???
Posted By: __n3o__
Subject: Web User Controls problem???
Date Posted: 18 May 2007 at 1:59pm
I hope someone can help…  I have an default.aspx page (Not a code behind) which is inheriting a class

<%@ Page Language="VB" Inherits="bf_include" %>


And in my page load I call a sub from the class which gives me some variables I can use on my page … All fine so farWink

Call BF_Getskin()

Now I am happily using the variables throughout the page where needed (strSkin in this case)

<%Response.Write("<link href=""/skins/" & strSkin & """ rel=""stylesheet"" type=""text/css"" />")%>

Now I have 2 Web User Controls in the page for the header and footer – Here is the Header (I am registering it at the top of the page in the normal manner)

<uc1:header id="Header1" runat="server"></uc1:header>

Now this is where I am tearing my hair out!!  I want (Sorry... NEED) to be able to use / reference those varibales (strSkin etc…) in the Header User Control.

But if I add this to the user control

<%Response.Write("<link href=""/skins/" & strSkin & """ rel=""stylesheet"" type=""text/css"" />")%>

I get this error??

Name 'strSkin' is not declared.

How can I make my usercontrols inherit from the main page?? Ouch Ouch Ouch Ouch Ouch Ouch ... any help appreciated




Replies:
Posted By: __n3o__
Date Posted: 18 May 2007 at 2:27pm
Figured it out....

Only way I can do it is to create a property in the user control & reference it from the page...



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net