Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Data Binding Exceptions - Intercepting

Reply
Thread Tools

Data Binding Exceptions - Intercepting

 
 
Philip
Guest
Posts: n/a
 
      10-27-2008
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.



--
Philip
 
Reply With Quote
 
 
 
 
Philip
Guest
Posts: n/a
 
      10-27-2008
Additional information on the DropDownList dataBinding problem is as
follows....

here is source code...

<aspropDownList 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.



--
Philip


"Philip" wrote:

> 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.
>
>
>
> --
> Philip

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Intercepting binding? andrew cooke Python 11 09-25-2009 01:53 PM
Complex data binding question, binding child objects of a custom collection. JcFx ASP .Net Datagrid Control 0 06-01-2005 04:01 PM
Intercepting data flow between 2 apps Richard Anderson Perl Misc 5 02-25-2005 09:51 AM
Checked exceptions vs unchecked exceptions Ahmed Moustafa Java 5 07-14-2004 01:46 PM
Data Binding - using inline code vs. functions vs. straight binding Jordan ASP .Net 2 02-10-2004 08:32 PM



Advertisments