By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,903 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

Event not firing

P: n/a
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_SelectedIndexChan ged"
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_SelectedIndexChang ed"
AutoPostBack="True"></asp:DropDownList>
</p>
....

Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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.

"SirPoonga" <ke*********@gmail.com> wrote in message
news:11*********************@c13g2000cwb.googlegro ups.com...
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_SelectedIndexChan ged"
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_SelectedIndexChang ed"
AutoPostBack="True"></asp:DropDownList>
</p>
...

Nov 19 '05 #2

P: n/a
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.

Nov 19 '05 #3

P: n/a
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.

Nov 19 '05 #4

P: n/a
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.

Nov 19 '05 #5

P: n/a
SirPoonga wrote:
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...

--
Software is like sex: it's better when it's free -- [Linus Torvalds]

Fabio Marini - A+, RHCT, MCDBA, MCAD.NET
To reply: news [at] mamakin1976 [dot] plus [dot] com
Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.