Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 6th, 2005, 10:36 AM
Registered User
 
Join Date: Aug 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pass Variable Value To User Control From Host Page

I am trying to pass the value of a varible to a user control (code behind) from the host page of the user control. In the uc code behind I am using Get...Set to retrive the value and if I use a static string (i.e "blk") it works but I cannot get it to work using (<%#variable%>. Here is the code:

In the user control code behind
Code:
        Public mainSkin As String

        Public Property ucSkin() As String
            Get
                Return ucSkin
            End Get
            Set(ByVal value As String)
                mainSkin = value
            End Set
        End Property
Here is the code from the host page
Code:
<jsFlsAd:flsAd  id="FlsAd" runat="server" ucSkin= "<%#varSkin%>"></jsFlsAd:flsAd>
Where varSkin is declared as Public in the code behind of the host page.

The above line does not work, however if I change it to:
Code:
<jsFlsAd:flsAd  id="FlsAd" runat="server" ucSkin= "blk">jsFlsAd:flsAd>
That will work.
Can someone help me understand what I am doing wrong?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing controls in host page from User Control Axe BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X 1 March 16th, 2011 06:22 AM
User Control not rendering in Master Page skmcusp ASP.NET 2.0 Basics 2 September 10th, 2007 04:58 PM
Pass XSL variable back to asp.net page ayamas XSLT 8 September 14th, 2006 06:07 AM
Changing Page Title From User Control [email protected] ASP.NET 1.0 and 1.1 Professional 5 October 11th, 2005 08:48 AM
strange behaviour: session variable/virtual host ahfaich Pro PHP 8 May 12th, 2004 11:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.