Page.DataBind()

G

Guest

Hello, when I place the command of "Page.Databind()" into my program, the program generates and error saying "value was outside of range". If I take the instruction out, then the page displays and does not abend. Of course the fields that I want to display data do not have data on them

I have 5 instructions which are of the <%# %> variety. If I take all of them out, and leave in the page bind, the same error occurs. I have seached the page for "value" and the only hits I get are the "value" attribute for the dropdown boxes

What else should I be looking at to find "Specified argument was out of the range of valid values. Parameter name: value " error

Thanks in advance for your assistance.........
 
C

Candan Akyol

Hello Jim,

Can you send the stack trace of the exception? This will help to determines
which control is raising the error.

Jim Heavey said:
Hello, when I place the command of "Page.Databind()" into my program, the
program generates and error saying "value was outside of range". If I take
the instruction out, then the page displays and does not abend. Of course
the fields that I want to display data do not have data on them.
I have 5 instructions which are of the <%# %> variety. If I take all
of them out, and leave in the page bind, the same error occurs. I have
seached the page for "value" and the only hits I get are the "value"
attribute for the dropdown boxes.
What else should I be looking at to find "Specified argument was out of
the range of valid values. Parameter name: value " error?
 
J

Joe Fallon

One idea: when you set the datasource for your cbo, do you also set a
SelectedValue?
Comment that out and then try binding.

I think that the Items collection of many controls is not filled until you
call databind so you cannot set things like SelectedValue until after the
call to databind.
--
Joe Fallon



Jim Heavey said:
Hello, when I place the command of "Page.Databind()" into my program, the
program generates and error saying "value was outside of range". If I take
the instruction out, then the page displays and does not abend. Of course
the fields that I want to display data do not have data on them.
I have 5 instructions which are of the <%# %> variety. If I take all
of them out, and leave in the page bind, the same error occurs. I have
seached the page for "value" and the only hits I get are the "value"
attribute for the dropdown boxes.
What else should I be looking at to find "Specified argument was out of
the range of valid values. Parameter name: value " error?
 

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,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top