Event not firing

S

SirPoonga

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

Marina

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

SirPoonga

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

SirPoonga

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

SirPoonga

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

Fabio

SirPoonga said:
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.

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

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

Top