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
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