Data Binding Exceptions - Intercepting

Discussion in 'ASP .Net Web Controls' started by Philip, Oct 27, 2008.

  1. Philip

    Philip Guest

    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
     
    Philip, Oct 27, 2008
    #1
    1. Advertising

  2. Philip

    Philip Guest

    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.



    --
    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
     
    Philip, Oct 27, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Timothy Parez
    Replies:
    0
    Views:
    393
    Timothy Parez
    Mar 6, 2004
  2. Jordan
    Replies:
    2
    Views:
    2,548
    Jordan
    Feb 10, 2004
  3. andrew cooke

    Intercepting binding?

    andrew cooke, Sep 24, 2009, in forum: Python
    Replies:
    11
    Views:
    425
    Carl Banks
    Sep 25, 2009
  4. JcFx
    Replies:
    0
    Views:
    291
  5. Richard Anderson

    Intercepting data flow between 2 apps

    Richard Anderson, Feb 21, 2005, in forum: Perl Misc
    Replies:
    5
    Views:
    168
    Richard Anderson
    Feb 25, 2005
Loading...

Share This Page