Binding RadioButtonList ...

  • Thread starter Thread starter Ivan Demkovitch
  • Start date Start date
I

Ivan Demkovitch

Hi!

I wonder if thats a bug or something:

I have an object which has arrayList of child objects exposed to clients.
This child object also exposed to clients.

Class A
{
public ArrayList CurrentList = new ArrayList();
}

Class B
{
int _DetlKey;
string _Detl;

public int DetlKey
{
get
{
return this._DetlKey;
}
set
{
_DetlKey = value;
}
}

public string Detl
{
get
{
return this._Detl;
}
set
{
_Detl = value;
}
}
}


//code to populate array list omitted.


Then I use this code to bind my List:

rbList.DataSource = A.CurrentList;
rbList.DataBind();

And I get error:

Exception Details: System.Web.HttpException: DataBinder.Eval:
'ASPNetPortal.B' does not contain a property with the name DetlLey.

What is the problem here?

I searched NG and came up with posts saying that properties have to be
actual properties in classes, not fields. I changed class (it's in example)
but steel get error.


Any ideas?
 
While there are plenty of bugs in software as big as ASP.NET, it's best to
assume that the bug is in your code until you have conclusively proven
otherwise.

In this case, you are throwing the error in your DataBinder.Eval call, which
you don't show. I would step through your code to find the exact line, and
then post what you are doing in the Eval statement to give us a feel for
what you are doing when the error occurs. There is nothing to indicate that
you are having a problem with the binding, at least that I can see.
 
Back
Top