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 12th, 2005, 08:57 AM
Friend of Wrox
 
Join Date: Apr 2004
Posts: 204
Thanks: 0
Thanked 0 Times in 0 Posts
Default Wierdness When Passing Properties to User Controls

Hi,

I'm relatively new to User Controls, so forgive me if this is a dumb question.

In passing various properties to a User Control from the main ASPX page, as in the example below...

    <aar:SecondNavs runat="server" id="GiveNavs" ActivePage="Donate" Source="Give" />

... I run into situations where sometimes the User Control doesn't "See" one of the properties. Within the User Control I have the Property declared as a Public variable.

In the example above the User Control started out accepting only 1 property: ActivePage. Then I added the second one, Source, by adding another Public variable in the codebehind for the User Control, and adding the Source="Give" line to main page. The User Control did not see the value of "Give" for that property, but instead saw an empty string.

What fixed this was simply changing the order of the properties in the main page, from

    <aar:SecondNavs runat="server" id="GiveNavs" ActivePage="Donate" Source="Give" />

to

    <aar:SecondNavs runat="server" id="GiveNavs" Source="Give" ActivePage="Donate" />

Then all of a sudden my User Control could "see" the value of "Give" for the Source Property.

Any idea what's up with this? Is this another Visual Studio 2003 failing?

Thanks.

Aaron







Similar Threads
Thread Thread Starter Forum Replies Last Post
Properties In User Controls - A Tip And Trick Muhammad Zeeshan ASP.NET 2.0 Basics 0 November 23rd, 2007 03:51 AM
Properties In User Controls - A Tip And Trick Muhammad Zeeshan ASP.NET 2.0 Professional 0 September 20th, 2007 10:49 PM
Passing Params to User Controls in ASP 2.0 (VB) gcm_uk ASP.NET 2.0 Basics 8 April 30th, 2007 01:35 PM
Accessing Properties in User Controls andyj00 ASP.NET 1.0 and 1.1 Professional 16 August 1st, 2005 07:55 AM
Accessing Properties in User Controls andyj00 Classic ASP Professional 1 May 21st, 2005 02:52 PM





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