problem with parsing control property

S

Sergey

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top