0

I have 2 server control

One create Items the other one create a List of items.

So i have a public Item with a viewstate in the first in the page when i add the server control name (Server control name 1) to a panel it render (with a createChildControls) and add to a public List<Server Name 1> that is a view state in the server control 2.

so i make

foreach  (ServerControl_1 a in ServerControl_2)

output += a;

the result is the namespace of the item not the text.

So i must have to render it first and then add to the output... But i just dont know how...

Someone help me?

4

1 回答 1

0

使用类似的东西

        protected String displayName(Object item)
        {
            String name = "";
            if (item != null && item.hasOwnProperty("name")) {
                name = item["name"];
            }
            return name;
        }

在你的 for 循环中调用它。

output += displayName(a)
于 2013-01-18T13:21:13.330 回答