OnSelectedIndexChanged on DDL not working? IE6.0.2 bug?

G

Groove

I have a strange problem. It seems that for some reason, a
OnSelectedIndexChanged event is no producing an error in IE6. What concerns
me is that I just performed that large Windows update a couple of weeks ago
and it updated ActiveX "stuff" in IE. I'm not sure if the update has
effected IE or there's something wrong with mt .net application.

I have a simple DDL. It calls a sub when the value in the DDL is changed.
Now, when I change the value, IE displays the js error msg box and says:

'event' is null or not an object.Line X, character X.

It gets weird. It refers to a place in my code that makes no sense. There's
no javascript or anything .net generated on line X. Furthermore, I deleted
massive amounts of makr up code as a test. I wanted to see if the reference
to line x changed. I refreshed and tested the page. Same error even though
a 100+ lines of code are now gone (html), it still references to the same
place in my code! The page works fine as it always did in Firefox 1.5.

My simple code:

<asp:DropDownList ID="ddlCapitalItems" runat="server" BackColor="#FFFFFF"
Font-Names="Verdana,Arial" Font-Size="8pt" AutoPostBack="True"
OnSelectedIndexChanged="ddlCapitalItems_SelectedIndexChange" />





Protected Sub ddlCapitalItems_SelectedIndexChange(ByVal Sender As Object,
ByVal E As EventArgs)

'------------------------------------------------------------------------------------

'- This sub routine is called when the Capital Items Drop Down List is
changed. -

'- If checks to see if the user selected "Other" and if so, it will enable
the -

'- the txtOtherDesc control and related validation controls. -

'------------------------------------------------------------------------------------



If ddlCapitalItems.SelectedValue = 1 Then

txtOtherDesc.Enabled = True

txtOtherDesc.Text = ""

OtherDescRequired.Enabled = True

Else

txtOtherDesc.Enabled = False

txtOtherDesc.Text = "Not Required"

OtherDescRequired.Enabled = False

End If



End Sub
 
G

Groove

to add additional info. I tested my page on someone else's PC with IE6 and
it fails there too. Make me think it is not the Windows update but rather
my application. I whipped up a quick test page like below and it works
fine.

Any ideas?? Thanks!




<%@ Page Language="VB" %>

<script runat="server">

Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs)

Label1.Text = DropDownList1.SelectedValue

End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title>Untitled Page</title>

</head>

<body>

<form runat="server">

&nbsp;<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br />

<br />

<br />

<asp:DropDownList ID="DropDownList1" runat="server"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"
AutoPostBack="true">

<asp:ListItem>Red</asp:ListItem>

<asp:ListItem>Blue</asp:ListItem>

</asp:DropDownList>

</form>

</body>

</html>
 

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

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top