Catch exception thrown by DropDownList set Declaratively

Discussion in 'ASP .Net' started by drop, Feb 7, 2007.

  1. drop

    drop Guest

    Hi,

    I have some DropDownLists that are contained in a DetailsView. Here's
    a sample of my code for the DropDownLists :

    <InsertItemTemplate>
    <asp:DropDownList ID="ddl_TourOp" runat="server"
    DataSourceID="ods_TourOp"
    DataTextField="Text" DataValueField="Value"
    SelectedValue='<%# Bind("Provider") %>'></
    asp:DropDownList>
    </InsertItemTemplate>

    Since I set the SelectedValue declaratively using the Bind, is there
    anyway I can intercept an exception thrown if the SelectedValue is not
    valid?

    I found that this is possible for some Controls ( example :
    DetailsView OnItemInserted ) by using the EventArgs, but I haven't
    found any way to do it this way with the DropDownList.

    Anyone has any idea on how I can do this?

    Thank you
    Simon Picard
    drop, Feb 7, 2007
    #1
    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. Fao, Sean
    Replies:
    5
    Views:
    404
    Fao, Sean
    Jul 6, 2003
  2. podi
    Replies:
    3
    Views:
    26,999
  3. Replies:
    1
    Views:
    623
    Ivan Vecerina
    May 15, 2006
  4. Bogdan
    Replies:
    0
    Views:
    739
    Bogdan
    May 20, 2008
  5. Marteno Rodia

    catch doesn't catch a thrown exception

    Marteno Rodia, Aug 3, 2009, in forum: Java
    Replies:
    5
    Views:
    565
    Daniel Pitts
    Aug 5, 2009
Loading...

Share This Page