Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Web User Controls problem???
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Web User Controls problem???

 Post Reply Post Reply
Author
__n3o__ View Drop Down
Groupie
Groupie
Avatar

Joined: 08 November 2005
Location: United Kingdom
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote __n3o__ Quote  Post ReplyReply Direct Link To This Post Topic: Web User Controls problem???
    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

Back to Top
__n3o__ View Drop Down
Groupie
Groupie
Avatar

Joined: 08 November 2005
Location: United Kingdom
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote __n3o__ Quote  Post ReplyReply Direct Link To This Post 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...
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.