J
Joe
I wrote a customized dropdownlist by inheriting
System.Web.UI.WebControls.DropDownList
My dropdownlist has some of its own properties which need to be assigned in
runtime. In my aspx, I try to call a function from codebehind like this:
<MyControl:MyDropDownList id=MyDropDownList1 runat="server"
MyProperty="<%# Test1()%>"> DataTextField="<%# Test2()%>">
</MyControl:MyDropDownList>
It is strange that Test1() is not called at all for MyProperty. However,
Test2() is being called since DataTextField is a property for the base
class.
Does anyone know what is the problem? How should I implement a property of
a derived web control? Thank a lot for your time!
System.Web.UI.WebControls.DropDownList
My dropdownlist has some of its own properties which need to be assigned in
runtime. In my aspx, I try to call a function from codebehind like this:
<MyControl:MyDropDownList id=MyDropDownList1 runat="server"
MyProperty="<%# Test1()%>"> DataTextField="<%# Test2()%>">
</MyControl:MyDropDownList>
It is strange that Test1() is not called at all for MyProperty. However,
Test2() is being called since DataTextField is a property for the base
class.
Does anyone know what is the problem? How should I implement a property of
a derived web control? Thank a lot for your time!