Passing An object to a UserControl

Z

Zean Smith

In ASPX, is it possible to pass an object , for example an arraylist to a
public property? something like this....

<uc1:test id="myUserControl" runat="server"
List='<%=_myArrayList%>'></uc1:test>

I know I can use:
myUserControl.List = _myArrayList;

But I just want to see if it is possible to shorten the code. Thanks
 
G

Guest

I do not do it personally, but the answer is yes. You will likely want to
expose it through a property or a method, however.

Be careful when bouncing from programatic control of the page to declarative
control. It is easy to make a mistake when you are mixing metaphors.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

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,780
Messages
2,569,611
Members
45,279
Latest member
LaRoseDermaBottle

Latest Threads

Top