Event not firing

Discussion in 'ASP .Net' started by SirPoonga, Jan 14, 2005.

  1. SirPoonga

    SirPoonga Guest

    I have a form with several DropDowns and DataGrids. They all work the
    way they are suppose except one dropdown. When I select an option it's
    SelectedIndexChanged event is not firing. When the page refreshes the
    original (first) item is selected. I even bookmarked the event in the
    debugger to see if it runs through that code.
    In the following code the ddBoltOn dropdown box is the problem one.

    Note: Web matrix produce the majority of the code.

    <script runat="server">
    ....
    Sub ckBoltOn_CheckedChanged(sender As Object, e As EventArgs)
    toggle_ckBoltOn
    End Sub

    Sub ddBoltOn_SelectedIndexChanged(sender As Object, e As EventArgs)
    update_ddBoltOn
    End Sub

    Sub ckOther_CheckedChanged(sender As Object, e As EventArgs)
    toggle_ckOther
    End Sub

    Sub ddOther_SelectedIndexChanged(sender As Object, e As EventArgs)
    update_ddOther
    End Sub

    </script>
    <html>
    ....
    <p>
    Bolt On S.C.:
    <asp:CheckBox id="ckBoltOn" runat="server" AutoPostBack="True"
    OnCheckedChanged="ckBoltOn_CheckedChanged"></asp:CheckBox>
    <asp:DropDownList id="ddBoltOn" runat="server"
    OnSelectedIndexChanged="ddBoltOn_SelectedIndexChanged"
    AutoPostBack="True"></asp:DropDownList>
    </p>
    <p>
    Other:
    <asp:CheckBox id="ckOther" runat="server" AutoPostBack="True"
    OnCheckedChanged="ckOther_CheckedChanged"></asp:CheckBox>
    <asp:DropDownList id="ddOther" runat="server"
    OnSelectedIndexChanged="ddOther_SelectedIndexChanged"
    AutoPostBack="True"></asp:DropDownList>
    </p>
    ....
     
    SirPoonga, Jan 14, 2005
    #1
    1. Advertisements

  2. SirPoonga

    Marina Guest

    Are you repopulating the dropdown in page_load maybe? So wiping out the
    selected item by repopulating the dropdown, as opposed to letting viewstate
    deal with it.
     
    Marina, Jan 14, 2005
    #2
    1. Advertisements

  3. SirPoonga

    SirPoonga Guest

    I was thinking that too at a point. I put a breakpoint at every spot
    ddBoltOn or ckBoltOn is refered to. None of that was executed.

    FYI, the check boxes enable and disable the dropdowns.

    This form is a product selection form. You used the various drop downs
    and datagrids to to select through the products. At the end a Bill of
    Materials for Engineering and Manufacturing will be produced to create
    that product. So the checkboxes indicate if the user wants that option
    or not. Would disabling and enabling the controls affect how the event
    is handled?

    My next step is to simplify the page with just that dropdown. See if
    it happens with just that control on the page.
     
    SirPoonga, Jan 14, 2005
    #3
  4. SirPoonga

    SirPoonga Guest

    Here's my Page_Load
    Sub Page_Load
    db_connect
    If Not Page.IsPostBack Then
    'Page initialization stuff. Will run on non Post Back
    events.
    update_ddBucket
    End If
    End Sub

    A PostBack should just connect to the database, stepping through the
    code with the debugger showed this to be correct.
     
    SirPoonga, Jan 14, 2005
    #4
  5. SirPoonga

    SirPoonga Guest

    My Bad. It's my fault :) All the itms in the dropdown ended up
    getting the same Value. SOOOOO, it wouldn't fire the event because the
    selected item really didn't change in value.
     
    SirPoonga, Jan 14, 2005
    #5
  6. SirPoonga

    Fabio Guest

    SirPoonga,
    I had the very same problem once - the solution? Reset IE security settings to
    default! Give it a try and let us know...

    PS: Imagine my surprise when the aspx was working with mozilla, but not IE...
     
    Fabio, Jan 15, 2005
    #6
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.