Last post Nov 10, 2005 09:54 AM by atrehan
Nov 10, 2005 09:54 AM|atrehan|LINK
I had created a Control that extends Drop Down List, what i am trying to do is pull the data from the dtabase depending on one of the property. I had created a contrrol that is working properly except two Issues.
1) There is one custom property in the control on the basis of which Data is filled in the Drop Down List. The Drop down works properly when this property is set from the tags on the aspx page. when i set the property from the Code Behind it dosent get executed.
<my:dropdown id="ddl" runat="server" customProperty="123"></my:dropdown>
Here if i initialize the property customProperty it works fine. But if i write the same property in Code behind file like
ddl.customProperty="123", it doesn't work.
2) There is one more prooperty that binds the Data to the Drop down ist , when i add the property to the control tag at Design Time the control is not created and shows an error, but at runtime it works properly. It means the property for data source is running
at the Design time and throwing error. So i wan to know how can the properties be added at the runtime.
<my:dropdown id="ddl" runat="server" customProperty="123" returnData=""></my:dropdown>
Here returnData is the property that sets the DataSource
WriteOnly Property returnData()
MyBase.DataSource = getData()
getData() is the function that returns the data from the Database.
when i add the property returnData to the control tag and try to view the control in Design view the control is not created at DesingTime but works fine at Runtime.
Any Direction will be heartly appreciated.