S
Steve B.
Hi,
On a page, I've a dropdownlist box that is bound to an object datasource
(which is a proxy to a web service).
I also have a gridview that is bound to another object datasource (a ws
too). The select method of this datasource has an argument which is type of
int? (Nullable<Int32>).
I want to set the select parameter value to the dropdown list value which
can be either any int or null.
I set up the drop down list to add one item : None with no value and other
items are from the object data source.
When I select any of the item in the DDL, the correct int value is send to
the select parameter.
However, when I select the manually added item with no value, this throw an
exception "Input string was not in correct format"... the control seems to
execute an Int.Parse(null) which throws the exception.
I found a workaround which is to set the None item's value to -1, but I need
to update the service to understant the -1 value like a null value... and
it's not a clean "3-tiers" solution.
How can I correctly reach my behaviour ?
Thanks in adcance,
Steve
On a page, I've a dropdownlist box that is bound to an object datasource
(which is a proxy to a web service).
I also have a gridview that is bound to another object datasource (a ws
too). The select method of this datasource has an argument which is type of
int? (Nullable<Int32>).
I want to set the select parameter value to the dropdown list value which
can be either any int or null.
I set up the drop down list to add one item : None with no value and other
items are from the object data source.
When I select any of the item in the DDL, the correct int value is send to
the select parameter.
However, when I select the manually added item with no value, this throw an
exception "Input string was not in correct format"... the control seems to
execute an Int.Parse(null) which throws the exception.
I found a workaround which is to set the None item's value to -1, but I need
to update the service to understant the -1 value like a null value... and
it's not a clean "3-tiers" solution.
How can I correctly reach my behaviour ?
Thanks in adcance,
Steve