PC Review


Reply
Thread Tools Rate Thread

Binding RadioButtonList ...

 
 
Ivan Demkovitch
Guest
Posts: n/a
 
      18th Aug 2003
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?




 
Reply With Quote
 
 
 
 
Chris Jackson
Guest
Posts: n/a
 
      19th Aug 2003
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.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--

"Ivan Demkovitch" <i@d> wrote in message
news:(E-Mail Removed)...
> 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?
>
>
>
>



 
Reply With Quote
 
Ivan Demkovitch
Guest
Posts: n/a
 
      19th Aug 2003
Chris,

Thanks for answering. Did you personally bind radiobuttonlist to ArrayList?

I'm using WebMatrix and cannot step thru code. But error is on
rbList.DataBind(); call

there is no call for DataBinder.Eval in my code.

Here is a link on a same problem in another post. Solution provided does not
work for me.
http://groups.google.com/groups?hl=e...oogle%2BSearch

Thanks,
Ivan

"Chris Jackson" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.
>
> --
> Chris Jackson
> Software Engineer
> Microsoft MVP - Windows XP
> Windows XP Associate Expert
> --
>
> "Ivan Demkovitch" <i@d> wrote in message
> news:(E-Mail Removed)...
> > 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?
> >
> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding RadioButtonList to a SQL bit column through SQLDataSource mbosco51@hotmail.com Microsoft ADO .NET 1 29th Apr 2008 07:10 PM
FormView - RadioButtonList binding =?Utf-8?B?VGlt?= Microsoft ASP .NET 2 28th Apr 2006 05:17 PM
Re: Data Binding - using inline code vs. functions vs. straight binding Alvin Bruney [MVP] Microsoft ASP .NET 0 9th Mar 2004 01:24 PM
Data Binding a Bit Column to RadioButtonList Michael Microsoft ASP .NET 1 2nd Jan 2004 07:15 PM
binding data to a radiobuttonlist within an ItemTemplate ani Microsoft ASP .NET 0 30th Oct 2003 09:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:55 AM.