Solved

Stack Overflow in IE and Not in Firefox

Posted on 2008-10-10
12
2,568 Views
Last Modified: 2008-10-18
This form works fine after selecting a value from the first dropdown. Selecting a value from the second dropdown, or clicking "Submit" returns a "Stack overflow at line:0" error in IE. The form works perfectly fine in Firefox.

Any idea what could be causing this? I'll include the full code from the markup and codebehind below.

Thanks for your attention!
Markup:
 
<%@ Page Language="VB" MasterPageFile="PageDataEntry.master" EnableEventValidation = "true" AutoEventWireup="false" CodeFile="CompsiteMachineInstall.aspx.vb" Inherits="Authenticate_CompsiteMachineInstall" title="Compsite Machine Installation Form" %>
 
<%@ Register Assembly="CustomControls" Namespace="CustomControls.Grid" TagPrefix="cc1" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
             
<asp:AccessDataSource ID="SelectCompsite" runat="server" DataFile="\\netatlas\networkdb\NetworkDB Backend\networkdb_be.mdb"
    SelectCommand="SELECT ShortLocation FROM QueryClusters ORDER BY ShortLocation" >
</asp:AccessDataSource> 
 
<asp:Panel ID="PnlCompsiteMachine" runat="server" Visible="true" DefaultButton="SubmitButton" >
 
<div id="graybanner"> 
    <h3 id="PageName">Compsite Machine Installation</h3>
<div id="instructions">
 
    <asp:AccessDataSource ID="DataSourceCustomer" runat="server" DataFile="\\networkdb_be.mdb" ></asp:AccessDataSource>     
    <asp:DetailsView ID="LoggedInUser" runat="server" AutoGenerateRows="false"
        DataSourceID="DataSourceCustomer"
        DataKeyNames="NetID"
        BorderWidth="0px"
        BorderColor="#FFCC66" 
        CellPadding="10" 
        Font-Names="Ariel"
        Font-Size="12px"
        RowStyle-Wrap="false"
        AllowPaging="false">           
        <Fields>
        <asp:TemplateField ShowHeader="false" >
           <ItemTemplate>
                <ul>
                <li>You are logged in as <font color="red"><%#Container.DataItem("FULLNAME")%></font> </li> 
                <li>Pink fields are required </li> 
                </ul>
           </ItemTemplate>
        </asp:TemplateField>
        </Fields>        
    </asp:DetailsView>    
  </div>
</div> 
 
<asp:Table ID="Table1" runat="server" CellPadding="2" BorderColor="#FFCC66" BorderWidth="1px" GridLines="Horizontal" Font-Size="12px" BackColor="LightYellow" Font-Names="Ariel" Wrap="false">
 
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Compsite:</asp:TableCell>
        <asp:TableCell>
                <asp:DropDownList ID="ShortLocation" runat="server" 
                    CssClass="requiredfield"
                    DataSourceID="SelectCompsite"
                    DataTextField="ShortLocation" 
                    DataValueField="ShortLocation" 
                    AutoPostBack="true" 
                    AppendDataBoundItems="true">
                <asp:ListItem Value="" Text="-- Select Compsite --"></asp:ListItem></asp:DropDownList>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" ControlToValidate="ShortLocation" ErrorMessage="Compsite cannot be blank" Text="&nbsp;*" runat="server" />
        </asp:TableCell>                
    </asp:TableRow>
 
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Job Number:</asp:TableCell>
        <asp:TableCell>
	        <asp:TextBox ID="JobNumber" runat="server" MaxLength="9" Wrap="false" CssClass="requiredfield" />
	        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" SetFocusOnError="true" ControlToValidate="JobNumber" ErrorMessage="Job Number cannot be blank" Text="&nbsp;*" runat="server" />
	        <asp:RegularExpressionValidator runat="server" id="RegularExpressionValidator1" SetFocusOnError="true" ControlToValidate="JobNumber" ValidationExpression="^\d{5,9}$" ErrorMessage = "Job Number must contain 5 to 9 digits" Text="&nbsp;*" />
        </asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>     
        <asp:TableCell HorizontalAlign="Right">Start Date:</asp:TableCell>
        <asp:TableCell>
            <asp:TextBox runat="server" id="InstallDate" ReadOnly="false" Text="-- Select Date --" Width="115" CssClass="requiredfield" />
           	<asp:RequiredFieldValidator ID="RequiredFieldValidator3" SetFocusOnError="true" ControlToValidate="InstallDate" ErrorMessage="Start Date cannot be blank" Text="*" runat="server" />
            <asp:RegularExpressionValidator runat="server" id="RegularExpressionValidator5" ValidationExpression="(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d" SetFocusOnError="true" ControlToValidate="InstallDate" ErrorMessage = "Date must be in the form MM/DD/YYYY" Text="*" />
        </asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Project/Grant:</asp:TableCell>
        <asp:TableCell>
	        <asp:TextBox ID="ProjectGrant" runat="server" MaxLength="7" Wrap="false" CssClass="requiredfield" />
	        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" SetFocusOnError="true" ControlToValidate="ProjectGrant" ErrorMessage="Project/Grant Number cannot be blank" Text="&nbsp;*" runat="server" />
	        <asp:RegularExpressionValidator runat="server" id="RegularExpressionValidator2" SetFocusOnError="true" ControlToValidate="ProjectGrant" ValidationExpression="^\d{7}$" ErrorMessage = "Project/Grant Number must contain 7 digits" Text="&nbsp;*" />
        </asp:TableCell>                 
    </asp:TableRow>    
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Manufacturer:</asp:TableCell>
        <asp:TableCell>
                <asp:DropDownList ID="Manufacturer" runat="server" 
                    DataTextField="Manufacturer" 
                    DataValueField="Manufacturer" 
                    AutoPostBack="true" 
                    AppendDataBoundItems="true">
                <asp:ListItem Value="" Text="-- Select Manufacturer --"></asp:ListItem>
                <asp:ListItem Value="Dell" Text="Dell"></asp:ListItem>
                <asp:ListItem Value="Dell Printer" Text="Dell Printer"></asp:ListItem>
                <asp:ListItem Value="HP Printer" Text="HP Printer"></asp:ListItem>
                <asp:ListItem Value="Mac" Text="Mac"></asp:ListItem>
                <asp:ListItem Value="Xerox Printer" Text="Xerox Printer"></asp:ListItem></asp:DropDownList>
        </asp:TableCell>                
    </asp:TableRow>
 
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Serial Number:</asp:TableCell>
        <asp:TableCell><asp:TextBox ID="SerialNumber" runat="server" Wrap="false" /></asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Model Type:</asp:TableCell>
        <asp:TableCell><asp:TextBox ID="ModelType" runat="server" Wrap="false" /></asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Keyboard Serial:</asp:TableCell>
        <asp:TableCell><asp:TextBox ID="KeyboardSN" runat="server" Wrap="false" /></asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Mouse Serial:</asp:TableCell>
        <asp:TableCell><asp:TextBox ID="MouseSN" runat="server" Wrap="false" /></asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Display Manufacturer:</asp:TableCell>
        <asp:TableCell><asp:TextBox ID="DisplayManufacturer" runat="server" Wrap="false" /></asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Display Model:</asp:TableCell>
        <asp:TableCell><asp:TextBox ID="DisplayModel" runat="server" Wrap="false" /></asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Display Serial:</asp:TableCell>
        <asp:TableCell><asp:TextBox ID="DisplaySN" runat="server" Wrap="false" /></asp:TableCell>                
    </asp:TableRow>    
    
</asp:Table>
 
<table>
    <tr>
        <td class="noshade" align="left" colspan="8" >
        <asp:Button Text="Submit" id="SubmitButton" runat="server" CausesValidation="true" OnClick="SendMail" /></td>
    </tr>		
</table>  
 
</asp:Panel>
 
<asp:Panel ID="PnlThankYou" runat="server" DefaultButton="SubmitButton" Visible="false" >
 
<div id="graybanner"> 
  <h3 id="pagename">Thank you!</h3>
  <div id="instructions">
    <ul>         
        <li>You'll receive confirmation e-mail.</li> 
        <li>You submitted the following information:</li> 
	</ul>
  </div>
</div>
 
<div id="summary" runat="server">
 
<asp:Table ID="Table2" runat="server" CellPadding="2" BorderColor="#FFCC66" BorderWidth="1px" GridLines="Horizontal" Font-Size="12px" BackColor="LightYellow" Font-Names="Ariel" Wrap="false">
 
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Compsite:</asp:TableCell>
        <asp:TableCell><%=Context.Items("ShortLocation")%></asp:TableCell>                
    </asp:TableRow>
 
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Job Number:</asp:TableCell>
        <asp:TableCell><%=Context.Items("JobNumber")%></asp:TableCell>               
    </asp:TableRow>
    
    <asp:TableRow>     
        <asp:TableCell HorizontalAlign="Right">Start Date:</asp:TableCell>
        <asp:TableCell><%=Context.Items("InstallDate")%></asp:TableCell>               
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Project/Grant:</asp:TableCell>
        <asp:TableCell><%=Context.Items("ProjectGrant")%></asp:TableCell>             
    </asp:TableRow>    
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Manufacturer:</asp:TableCell>
        <asp:TableCell><%=Context.Items("Manufacturer")%></asp:TableCell>            
    </asp:TableRow>
 
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Serial Number:</asp:TableCell>
        <asp:TableCell><%=Context.Items("SerialNumber")%></asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Model Type:</asp:TableCell>
        <asp:TableCell><%=Context.Items("ModelType")%></asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Keyboard Serial:</asp:TableCell>
        <asp:TableCell><%=Context.Items("KeyboardSN")%></asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Mouse Serial:</asp:TableCell>
        <asp:TableCell><%=Context.Items("MouseSN")%></asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Display Manufacturer:</asp:TableCell>
        <asp:TableCell><%=Context.Items("DisplayManufacturer")%></asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Display Model:</asp:TableCell>
        <asp:TableCell><%=Context.Items("DisplayModel")%></asp:TableCell>                
    </asp:TableRow>
    
    <asp:TableRow>
        <asp:TableCell HorizontalAlign="Right">Display Serial:</asp:TableCell>
        <asp:TableCell><%=Context.Items("DisplaySN")%></asp:TableCell>                
    </asp:TableRow>    
    
</asp:Table>
 
</div>
 
</asp:Panel>
 
<div id="divResults" runat="server" />
    <asp:ValidationSummary ID="ValidationSummary"
        ShowMessageBox="true"
        ShowSummary="false"
        HeaderText="Please note:"
        EnableClientScript="true"
        runat="server"/> 
</asp:Content>
 
CodeBehind:
 
Imports System.Data.OleDb
Partial Class Authenticate_CompsiteMachineInstall
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        InstallDate.Text = DateTime.Now.ToString("MM/dd/yyyy")
    End Sub
    Private Shared Function StripDomain(ByVal username As String) As String
        Return username.Remove(0, username.IndexOf("\") + 1)
    End Function
    Protected Sub DataSourceCustomer_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataSourceCustomer.Init
        DataSourceCustomer.SelectCommand = "SELECT FIRSTNAME, LASTNAME, FULLNAME, NETID, EMAIL_ADDRESS, DomainNetID FROM Customer WHERE ([NetID] = '" & StripDomain(User.Identity.Name) & "')"
    End Sub
    Public Sub SendMail(ByVal Sender As Object, ByVal e As EventArgs)
 
        'create the mail message
        Dim msg As String
        Dim MailObj As New Net.Mail.MailMessage
 
        'set the addresses
        MailObj.From = New Net.Mail.MailAddress("from", "from")
        MailObj.To.Add(User.Identity.Name.Replace("domain\", String.Empty) + "@domain")
        MailObj.To.Add("add")
 
        'set the content
 
        msg = "Compsite Machine Installation:" & "<br><hr>"
 
        msg += "<table border='1' cellpadding='3' cellspacing='1' bgcolor='#dddddd'>"
        msg += "<tr><td bgcolor='#EEEEEE' align='right'>" & "Technician:" & "</td><td bgcolor='#FFFFDD' colspan='3'>" & (User.Identity.Name.Replace("PRINCETON\", String.Empty) + "@princeton.edu") & "</td></tr>"
        msg += "<tr><td bgcolor='#EEEEEE' align='right'>" & "Compsite:" & "</td><td bgcolor='#FFFFDD' colspan='3'>" & ShortLocation.Text & "</td></tr>"
        msg += "<tr><td bgcolor='#EEEEEE' align='right'>" & "Job Number:" & "</td><td bgcolor='#FFFFDD'>" & JobNumber.Text & "</td></tr>"
        msg += "<tr><td bgcolor='#EEEEEE' align='right'>" & "Start Date:" & "</td><td bgcolor='#FFFFDD'>" & InstallDate.Text & "</td></tr>"
        msg += "<tr><td bgcolor='#EEEEEE' align='right'>" & "Project Grant:" & "</td><td bgcolor='#FFFFDD'>" & ProjectGrant.Text & "</td></tr>"
 
        msg += "<tr><td bgcolor='#EEEEEE' align='right'>" & "Manufacturer:" & "</td><td bgcolor='#FFFFDD' colspan='3'>" & Manufacturer.Text & "</td></tr>"
        msg += "<tr><td bgcolor='#EEEEEE' align='right'>" & "Serial Number:" & "</td><td bgcolor='#FFFFDD' colspan='3'>" & SerialNumber.Text & "</td></tr>"
        msg += "<tr><td bgcolor='#EEEEEE' align='right'>" & "Model Type:" & "</td><td bgcolor='#FFFFDD'>" & ModelType.Text & "</td></tr>"
        msg += "<tr><td bgcolor='#EEEEEE' align='right'>" & "Keyboard Serial:" & "</td><td bgcolor='#FFFFDD'>" & KeyboardSN.Text & "</td></tr>"
        msg += "<tr><td bgcolor='#EEEEEE' align='right'>" & "Mouse Serial:" & "</td><td bgcolor='#FFFFDD' colspan='3'>" & MouseSN.Text & "</td></tr>"
        msg += "<tr><td bgcolor='#EEEEEE' align='right'>" & "Display Manufacturer:" & "</td><td bgcolor='#FFFFDD' colspan='3'>" & DisplayManufacturer.Text & "</td></tr>"
        msg += "<tr><td bgcolor='#EEEEEE' align='right'>" & "Display Model:" & "</td><td bgcolor='#FFFFDD'>" & DisplayModel.Text & "</td></tr>"
        msg += "<tr><td bgcolor='#EEEEEE' align='right'>" & "Display Serial:" & "</td><td bgcolor='#FFFFDD'>" & DisplaySN.Text & "</td></tr>"
        msg += "</table>"
 
        MailObj.Body = msg
        MailObj.Subject = "NetAtlas Compsite Machine Installation"
        MailObj.IsBodyHtml = True
 
        'send the message using the network layer
        Dim smtp As New Net.Mail.SmtpClient("server")
        smtp.Send(MailObj)
 
        'Storing in Context
        Context.Items("ShortLocation") = ShortLocation.Text
        Context.Items("JobNumber") = JobNumber.Text
        Context.Items("InstallDate") = InstallDate.Text
        Context.Items("ProjectGrant") = ProjectGrant.Text
 
        Context.Items("Manufacturer") = Manufacturer.Text
        Context.Items("SerialNumber") = SerialNumber.Text
        Context.Items("ModelType") = ModelType.Text
        Context.Items("KeyboardSN") = KeyboardSN.Text
        Context.Items("MouseSN") = MouseSN.Text
        Context.Items("DisplayManufacturer") = DisplayManufacturer.Text
        Context.Items("DisplayModel") = DisplayModel.Text
        Context.Items("DisplaySN") = DisplaySN.Text
 
        PnlCompsiteMachine.Visible = False
        PnlThankYou.Visible = True
 
    End Sub
End Class

Open in new window

0
Comment
Question by:davewalter1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
12 Comments
 

Author Comment

by:davewalter1
ID: 22686664
Additional note: This code works fine in IE and Safari on the Mac, and in Opera on a Windows platform.
0
 
LVL 16

Expert Comment

by:Gyanendra Singh
ID: 22700436
0
 

Author Comment

by:davewalter1
ID: 22701671
Thanks for the response! But debugging on the browser side was already disabled.  I fiddled with the settings, but no joy. This code doesn't do anything complex, and I don't see anything that would cause a loop... I'm stumped.
0
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

 
LVL 22

Expert Comment

by:prairiedog
ID: 22702596
Do you have JavaScript on your page?
0
 

Author Comment

by:davewalter1
ID: 22702662
I would have to say yes, although if my understanding is correct, what I have is VB script which is then rendered as JavaScript by the browser.

All of the code is above. ..
0
 
LVL 22

Expert Comment

by:prairiedog
ID: 22702995
>>>All of the code is above. ..
How about DropDownList's event handler?
0
 

Author Comment

by:davewalter1
ID: 22703050
Does it need an event handler? The markup and code behind are both in my original post... I think the only event is SendMail -- the two DropDownLists are just selectors...
0
 
LVL 22

Expert Comment

by:prairiedog
ID: 22703206
Because you set "AutoPostBack=true" for both DropDownList controls, which makes me think you have event handler to handle SelectedIndexChanged event. But if you don't have them, you should set "AutoPostBack=false". I don't know if it will make any diffrence but the best practice is if you don't need postback, then don't generate it.
0
 

Author Comment

by:davewalter1
ID: 22704295
That's what I thought, too, as best practice. I had tried it on Friday with no joy. It does work now, but I suspect only because I also removed the dependent dropdown..

So I don't believe this has solved the underlying problem of two dependent dropdowns. It's an issue because I have another, very similar, form with a dependent dropdown. If I set them both to "false," it won't throw the stack error, but the dependent dropdown won't update. With both set to "true," the dependent value changes properly, but making another selection from either of those two dropdowns throws the stack error.
0
 
LVL 22

Expert Comment

by:prairiedog
ID: 22704385
Another thing you may want to look into is that you store a lot of things in Context, that might throw off something. I don't know, and I am just guessing.
0
 

Accepted Solution

by:
davewalter1 earned 0 total points
ID: 22704489
Okay, I know what's causing it. It's "MaintainScrollPositionOnPostback." It needs to be set to false. I have a global page directive setting it to "true," so I  have to override that in the particular page. That's just great unless you actually need to maintain the scroll position! So it would seem to be a bug, and AutopostBack, while best set to "false" unless needed, wasn't the problem.

Thanks very much for your help, though!
0
 
LVL 22

Expert Comment

by:prairiedog
ID: 22704539
Good to know.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
asp web application 3 55
SQL Server Serialization error 8 43
Open telerik datetime picker programmatically 13 42
Call to SQL server times out 5 53
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question