Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2578
  • Last Modified:

Stack Overflow in IE and Not in Firefox

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
davewalter1
Asked:
davewalter1
  • 6
  • 5
1 Solution
 
davewalter1Author Commented:
Additional note: This code works fine in IE and Safari on the Mac, and in Opera on a Windows platform.
0
 
Gyanendra SinghArchitectCommented:
0
 
davewalter1Author Commented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
prairiedogCommented:
Do you have JavaScript on your page?
0
 
davewalter1Author Commented:
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
 
prairiedogCommented:
>>>All of the code is above. ..
How about DropDownList's event handler?
0
 
davewalter1Author Commented:
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
 
prairiedogCommented:
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
 
davewalter1Author Commented:
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
 
prairiedogCommented:
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
 
davewalter1Author Commented:
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
 
prairiedogCommented:
Good to know.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now