Page.DataBind()

  • Thread starter Thread starter Guest
  • Start date Start date
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.........
 
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?
 
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?
 
Back
Top