Accessing user control properties

D

David

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("PagesInFolder.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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top