problem with parsing control property

Discussion in 'ASP .Net Web Controls' started by Sergey, Aug 6, 2004.

  1. Sergey

    Sergey Guest

    I've implemented custom control (see below) and fill its properties
    out using databinding syntax (<%# %>).

    ------ aspx file ------
    <e:mycontrol id="someCtrlID" runat="server" Property1="<%#
    this.RootPath %>/Folder">
    <Data>
    <e:DataItem DataProperty="<%# this.RootPath %>/Folder" />
    </Data>
    </e:mycontrol>
    ----- aspx file ------
    ----- aspx.cs file -----
    class MyPage : Page
    {
    public string RootPath get { return "test"; }
    }
    class mycontrol : WebControl
    {
    .....
    public string Property1;
    public ArrayList Data;
    .....
    }
    [Serializable]
    class DataItem
    {
    ....
    public string DataProperty;
    ....
    }
    ----- aspx.cs file -----

    But there is one problem. On page load someCtrlID.Property1 has value
    == "test/Folder"
    but ((DataItem)someCtrlID.Data[0]).DataProperty has value == "<%#
    this.RootPath %>/Folder".
    DataItem properties didn't parse correct. I guess my DataItem class
    doesn't support databinding... but in this case DataItem is not a
    control itself. it is just store of information...

    What should I do?
    Sergey, Aug 6, 2004
    #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. Eric Newton
    Replies:
    3
    Views:
    9,355
    Brock Allen
    Apr 4, 2005
  2. Joshua Beall
    Replies:
    1
    Views:
    414
    Bertilo Wennergren
    Dec 10, 2003
  3. Noozer
    Replies:
    10
    Views:
    2,038
    Mitja
    Oct 13, 2004
  4. Nathan Sokalski
    Replies:
    25
    Views:
    1,410
    Nathan Sokalski
    Mar 4, 2010
  5. Samuel

    Update Property that mapped to a child control's property ?

    Samuel, Jan 23, 2006, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    177
    Steven Cheng[MSFT]
    Jan 24, 2006
Loading...

Share This Page