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. Advertisements

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. Nathan Sokalski
    Replies:
    1
    Views:
    464
    =?Utf-8?B?U2FjaGluIFNha2k=?=
    Sep 16, 2005
  2. Guest
    Replies:
    2
    Views:
    647
    Guest
    Oct 1, 2006
  3. TS
    Replies:
    5
    Views:
    529
    Steven Cheng[MSFT]
    Jul 6, 2007
  4. AleXmanFree
    Replies:
    3
    Views:
    825
    Hillbilly
    Oct 9, 2008
  5. Nathan Sokalski
    Replies:
    25
    Views:
    1,858
    Nathan Sokalski
    Mar 4, 2010
  6. Replies:
    0
    Views:
    283
  7. Chad
    Replies:
    0
    Views:
    410
  8. Samuel

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

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