Data Binding Exceptions - Intercepting

P

Philip

I am binding an ObjectDataSource value to a DropDownList DataValueField
field....using DataValueField="UserName" syntax. The DataSourceID for the
ObjectDataSource is DataSourceID="Users" for example.

If the field originating from the ObjectDataSource does not match an
available DropDownList value list....I get an exception. Is there a way to
trap such a DropDownList exception and take conditional action
?....conditional action being I may want to substitute another value for the
DropDownList SelectedValue and continue the DataBind operation.
 
P

Philip

Additional information on the DropDownList dataBinding problem is as
follows....

here is source code...

<asp:DropDownList ID="ddlESupervisorUserName" runat="server"
DataTextField="FullNameOrderByLast"
DataValueField="UserName"
Width="170px"
DataSourceID="ObjAllUsersRoleList"
SelectedValue='<%# Bind("SupervisorUserName") %>' />


The data being bound "SupervisorUserName"... does not match the DropDownList
list of value Values. How can I trap this exception ?....and substitute
another value.
 

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,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top