473,386 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Binding RadioButtonList ...

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?


Nov 17 '05 #1
2 2227
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:ed**************@TK2MSFTNGP09.phx.gbl...
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?

Nov 17 '05 #2
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" <ch****@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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:ed**************@TK2MSFTNGP09.phx.gbl...
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?


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hazzard | last post by:
I store radiobuttonlist values in the db using the string value of the radio button item value. (nvarchar) I am creating an edit functionality on the asp.net form so that when I reuse my...
0
by: ani | last post by:
Hi, I have a datalist control and within the Itemplate I have a radiobuttonlist control . I am binding data to the datalist control in Page_load . Also I have sqldatareader object that needs...
1
by: Tom | last post by:
Hi, I have a webform which has DropDownList, RadioButtonList and CheckBoxList. All values are in webform, but not select from DB table as they do not need to be used as search requirements. ...
1
by: Michael | last post by:
Hi, This should be fairly simple, but it is driving me nuts. First off I have a table in SQL Server, with a column of type "bit". This is meant to store a answer to a Yes/No question. I'm...
4
by: Emil | last post by:
Can somebody tell me what would be the syntax for having an if statement and setting the selected index of a radiobuttonlist? This is my first project using ASP.net and I use C#. I have a repeater...
2
by: nobody | last post by:
Why doesn't the casting of "e.Item.DataI­tem" as a "DataRow" (or even a "DataRowView" as in other online examples) work? I would love to get this type of code to work with my code that uses a...
2
by: Tim | last post by:
I have a radio button list control in the edit item template of a formview, as below. I want to bind this to a bit field from my sql database, however I can't seem to figure it out. Could some...
4
by: sck10 | last post by:
Hello, I am trying to use a radiobutton inside of a FormView for editing data. My question is how do you bind the radio buttons to the data field? Thanks, sck10 <td style="width:30%;...
3
by: Garudzo | last post by:
I am binding a radiobuttonlist to a data field in a database. If the field has a null value my application produces an error maybe because the null value wont be an item in the radio button list....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.