|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
OnSelectedIndexChanged on DDL not working? IE6.0.2 bug?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 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"> <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> Show quoteHide quote "Groove" <no***@noemail.com> wrote in message news:O5tywxdeGHA.1264@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_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 > > > > > >
Other interesting topics
Looping through Enum on Page_Load
GAC and Source Safe "Attached" Labels for TextBoxes, etc.? Same function different signatures "Can't use parentheses when calling a Sub" help...... DataGrid header question FormView and FileUpload JavaScript not working. question about using buttons to drive display ObjectDataSource question?? |
|||||||||||||||||||||||