Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 08, 2011 05:06 PM by nestorarturo
Member
320 Points
90 Posts
Mar 04, 2011 05:25 PM|LINK
HI.. I want to pass to my control a value to one of its parameter of type DropDownList. Something like:
<uc1:MyControl Id="01" runat="server" OtherControl="ddl1" />
Where "ddl1" is a DropDownList defined in the same page my control resides. How to create this kind of property?
All-Star
53942 Points
8147 Posts
Mar 04, 2011 06:35 PM|LINK
This is just a thought.
Create a string property and method to get the Control
public string CustomList { get { return Convert.ToString(ViewState["CustomList"]); } set { ViewState["CustomList"] = value; } } public DropDownList GetCustomList() { return Page.FindControl(CustomList) as DropDownList; }
Mar 08, 2011 05:06 PM|LINK
Sorry for being this late. As usual, the simplest solution are always the best. Thank you.
nestorarturo
Member
320 Points
90 Posts
How to: Web Control (or Custom Control) with property of type DropDownList
Mar 04, 2011 05:25 PM|LINK
HI.. I want to pass to my control a value to one of its parameter of type DropDownList. Something like:
<uc1:MyControl Id="01" runat="server" OtherControl="ddl1" />
Where "ddl1" is a DropDownList defined in the same page my control resides. How to create this kind of property?
www.bogotadotnet.org
silverideas.wordpress.com
sansan
All-Star
53942 Points
8147 Posts
Re: How to: Web Control (or Custom Control) with property of type DropDownList
Mar 04, 2011 06:35 PM|LINK
This is just a thought.
Create a string property and method to get the Control
nestorarturo
Member
320 Points
90 Posts
Re: How to: Web Control (or Custom Control) with property of type DropDownList
Mar 08, 2011 05:06 PM|LINK
Sorry for being this late. As usual, the simplest solution are always the best. Thank you.
www.bogotadotnet.org
silverideas.wordpress.com