Can not call codebehind function for inherited dropdownlist

Discussion in 'ASP .Net Web Controls' started by Joe, Nov 17, 2003.

  1. Joe

    Joe Guest

    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!
     
    Joe, Nov 17, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. moondaddy
    Replies:
    2
    Views:
    5,356
    Jim Cheshire [MSFT]
    Feb 27, 2004
  2. Replies:
    12
    Views:
    737
    fluden
    Feb 11, 2005
  3. JB
    Replies:
    0
    Views:
    2,285
  4. Phil Streiff
    Replies:
    3
    Views:
    923
    Teemu Keiski
    Apr 25, 2004
  5. 7stud --
    Replies:
    11
    Views:
    468
    7stud --
    Nov 9, 2007
Loading...

Share This Page