473,289 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

OnSelectedIndexChanged on DDL not working? IE6.0.2 bug?

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_SelectedIn dexChange" />

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


May 17 '06 #1
1 1851
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_SelectedInde xChanged"
AutoPostBack="true">

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

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

</asp:DropDownList>

</form>

</body>

</html>



"Groove" <no***@noemail.com> wrote in message
news:O5**************@TK2MSFTNGP05.phx.gbl...
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_SelectedIn dexChange" />

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


May 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jon Maz | last post by:
Hi, I have a user control which contains a DropDownList, and I want to be able to set the OnSelectedIndexChanged method of the DDL in the User Control from the holding aspx page. Depending on...
6
by: DotNetGruven | last post by:
I have a webform that has a DataGrid on it with a RadioButtonList in each row. It is a simple On & Off. When the User Clicks on either of the RadioButtons, I need to postback to the server and...
6
by: srallen | last post by:
I have a simple page that has a dropdown with autopostback=true and onselectedindexchanged is set to a function that never gets called (checked during debug). This page is subclassed from custom...
2
by: bienwell | last post by:
Hi, Does the OnSelectedIndexChanged event work when we mark on the checkbox on the cell of Datagrid control ? I tried to call this event; it didn't affect anything. Do you know any event that...
1
by: RedGST | last post by:
Hello, Im somewhat new to asp.net, so bear with me. I have created a form that has a Listbox along with 2 command buttons & a few other non-important controls. The command button is tied to...
1
by: Paul L | last post by:
Hi, I have an issue with the OnSelectedIndexChanged event not firing for a DropDownList control which is in the ItemTemplate of a DataList. I have made an exact copy of the DropDownList control,...
0
by: Bengt-Erik Eliasson | last post by:
Hi! In a DataGrid I have a 'Add New'-field in the footer. I want to hide an control (txtNewFe_name) if the value of cmbNewFe_num is >0. How do I do that? The OnSelectedIndexChanged does not seem...
2
by: glenn | last post by:
Hi folks, I am trying to determine which item in a DropDownList Web control has been selected. I have posted an OnSelectedIndexChanged subroutine in my code with a reference to the subroutine...
0
by: Groove | last post by:
(repost!) I have a simple and common scenario. I'm developing pages in VWD and FTP-ing them over to a test servr running Window 2003, NET2 Framework. On my page, I have a DDL that causes a...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.