This question is locked. New answers and comments are not allowed.
I have a class that includes a transient property...
Now, I'm getting an instance of MyClass from the DB using something like this...
Then I'm populating my 'Note' property locally...
Finally, I'm creating an IEnumerable that includes my "myClass" object and binding that as the DataSource of an asp:DetailsView.
If I look at the object assigned to the DetailsView.DataSource property I can see the Note property and I can see that it is populated.
However, the markup contains this ...
And the system reports an exception when trying to execute it. The exception reads "DataBinding: 'RSD.Model.MyClass' does not contain a property with the name 'Note'."
I don't understand why.
Can anyone shed any light on this for me?
TIA
--
Stuart
[Telerik.OpenAccess.Persistent(IdentityField = "id")]public class MyClass{ int id; string name; [FieldAlias("id")] public int ID { get { return id; } set { id = value; } } [FieldAlias("name")] public string Name { get { return name; } set { name = value; } } [Telerik.OpenAccess.Transient()] public string Note;}Now, I'm getting an instance of MyClass from the DB using something like this...
var x = from c in Scope.Extent<MyClass>() where c.ID.Equals(99) select c;Then I'm populating my 'Note' property locally...
MyClass myClass = x.FirstOrDefault();if(myClass != null){ myClass.Note = "blah";}Finally, I'm creating an IEnumerable that includes my "myClass" object and binding that as the DataSource of an asp:DetailsView.
If I look at the object assigned to the DetailsView.DataSource property I can see the Note property and I can see that it is populated.
However, the markup contains this ...
<asp:Label ID="Notes" runat="server" Text='<%# Eval("Note") %>' />And the system reports an exception when trying to execute it. The exception reads "DataBinding: 'RSD.Model.MyClass' does not contain a property with the name 'Note'."
I don't understand why.
Can anyone shed any light on this for me?
TIA
--
Stuart