Question : Populating ASPX control Target with Web.config value

I have a server side menu item control in an ASPX file.  There is a target parameter.
I'd like to set that target value at run-time using a combination of Web.Config value and a hard-coded string value through a code-behind functioned called "MakeTarget"    I thought that I could do it like this:
 Target='<%= MakeTarget("ServerStatus") %>'

But the runtime-rendering sets Target to be the literal value between the single quotes.

Any thoughts on how I can do this?
Thank you.

Answer : Populating ASPX control Target with Web.config value

Instead of doing it like that you can set the target at server side by looping through the menu items

        foreach (MenuItem mi in Menu2.Items)
        {
            if (mi.Value == "test")
                mi.Target = MakeTarget("ServerStatus");
        }

This can be executed in Page Load or any other event handler

-Ajitha
Random Solutions  
 
programming4us programming4us