F
Filippo
Hi there,
I am loading at RunTime a MENU.ascx control on the page and since I
need to update the URL paths, depending on the page that is making the
call, I need to get a reference to the MENU and reset the URL.
CODE:
======================================
// Get a refence of the control
MyMenu aMenu = (MyMenu) LoadControl("menu.ascx");
// update the URLs
UpdateURLs(aMenu);
// loads the control on the page
Page.Controls.Add(aMenu);
======================================
ISSUE:
When it runs the first line, the one that Loads the Control
an EXCEPTION occurrs:
======================================
The Control exists and loads ok if I directly load it into the page,
but I still need to get a reference of it in order to reset the URLS
of each node.
Any idea why?
F.
I am loading at RunTime a MENU.ascx control on the page and since I
need to update the URL paths, depending on the page that is making the
call, I need to get a reference to the MENU and reset the URL.
CODE:
======================================
// Get a refence of the control
MyMenu aMenu = (MyMenu) LoadControl("menu.ascx");
// update the URLs
UpdateURLs(aMenu);
// loads the control on the page
Page.Controls.Add(aMenu);
======================================
ISSUE:
When it runs the first line, the one that Loads the Control
an EXCEPTION occurrs:
======================================
The Control exists and loads ok if I directly load it into the page,
but I still need to get a reference of it in order to reset the URLS
of each node.
Any idea why?
F.