473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Accessing user control properties

Hi,

I have a user control that creates a menu structure, based on folders. I
also have another user control that creates sub menu based on files within
those folders.

I need to bring them togethor...

In my folder UC, I am dynamically generating the hyperlink, then adding it
to a place holder. The same with the files UC.

The Folder UC will then dynamically call the file UC for each folder.
However, I need to pass the folder ID so that the files can be generated.

I thought I had done something similar before, but I cannot find it in my
code base. :-(

Here is an example of what i mean...

private void BuildFolders(int ParentFolder
{
try
{
foreach (FolderChild fd in Folders.GetFolders(ParentFolder))
{
HyperLink newLink = new HyperLink();
newLink.Text = fd.DisplayName.ToString();
newLink.NavigateUrl = fd.Path.ToString() + fd.HomePage.ToString();
newLink.ToolTip = fd.Path.ToString();

Literal BRTag = new Literal();
BRTag.Text = "<br/>";

MenuPlaceHolder.Controls.Add(newLink);
MenuPlaceHolder.Controls.Add(BRTag);

MenuPlaceHolder.Controls.Add(LoadControl("PagesInF older.ascx"));

BuildFolders(fd.FolderID);

}
}
catch(Exception ex)
{
string exc = ex.Message;
}

}

As you can see, just before the recursive call to BuildFolders, I am having
a LoadControl. However, I need to pass the folder ID so that I render the
correct pages. How can I do that?

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
Apr 12 '07 #1
0 913

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Earl Teigrob | last post by:
I am writing an application that dynamically loads user controls at run time based on user options. I would like to give my users the ability to build their own user controls and add them to my...
1
by: Jeff Smith | last post by:
Can I load custom web user controls dynamically and access the properties and methods without having to explicitly define custom control types (example 2 below). I have custom web control named...
3
by: Craig G | last post by:
i have a user control which is basically a datagrid, which has add/edit/delete buttons on the grid is there anyway of accessing the actual datagrid from the form itself? basically i want to...
1
by: Reny J Joseph Thuthikattu | last post by:
Hi, I have added a web user control to my project and placed some common controls over there.In order to access the control from another web page i registered with it(aspx page) using register tag...
1
by: Brian | last post by:
Thanks for your time. I've created a web user control that has some properties available. I'm able to add the control dynamically (at run time) with no problem(.controls.add(). Is it possible...
6
by: arvee | last post by:
Is there a way to access controls (and their properties) in a user control? The Web Form Designer marks controls as 'Protected' which makes them inaccessable from the host form. If I mark them as...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
2
by: Vivek Sharma | last post by:
Hi There, I have a situation where I wish to load the controls dynamically on the basis of user role. Hence, I am using this code. if (UserRole == "IS Administrator") { Control UC1 =...
2
by: eagle | last post by:
How do I access a control, like a placeholder, from another page, or another user control that may be on the same page. For instance, I have a web page with 2 user controls. One user controls...
6
by: evandelagrammaticas | last post by:
Hi all. I have spent the better part of a day scouring the newsgroups and I am sure that I must have come across the solution a number of times - but I am still a real newbie at asp.net so please...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.