Response document is being truncated

First Question ever posted on here.!!!
I am developing an a home page in  I am using the obout EasyMenu control for the menu of the whole site.  It is actually in a masterpage (which may be part of the problem).  What I am seeing is that when I add too much code (it doesn't matter whether its comments or code) to the child page, some of the code that is generated from the EasyMenu control begins to be truncated.  The more code I add, the more that gets truncated, until all the sub items are gone.

The sub-menu items are actually added after the  </HTML> tag.  When I save the page source file, it seems to be about 30 kb.
Who is Participating?
If your page is well formed, then really the size shouldn't make a difference.  The thing is that something is causing your application to render invalid HTML.  If stuff from the menu is getting rendered after the closing HTML tag, then I tend to suspect the master page rendering...

Does your page have any problems if you comment out this line?

Me.Controls.Add(childEM) '
Check the markup code for the master page.  Make sure that the content place holder is not embedded in the menu tag.  You might consider pasting the markup for your master page if it's not very lengthy.
pasting the markup = posting the markup
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

smcdrcAuthor Commented:
Here is the .master page.

<%@ Master Language="VB" CodeFile="MainPage.master.vb" Inherits="MainPage" %>
<%@ Register Assembly="obout_EasyMenu_Pro" Namespace="OboutInc.EasyMenu_Pro" TagPrefix="oem" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" >
<head runat="server">
    <title>Wolverine Pipe Line Company</title>
    <link href="../styles/wpl.css" rel="stylesheet" type="text/css" />
<body topmargin="0" leftmargin="0">
    <form id="form1" runat="server">
        <table border="0" cellpadding="0" cellspacing="0">
            <img alt="Wolverine Pipe Line Company" src="../images/HeaderLogo.jpg" /></td></tr>
                    <asp:PlaceHolder ID="ph1" runat="server"></asp:PlaceHolder>
                <td> <asp:contentplaceholder id="MainBody" runat="server">
                <!--Footer area -->
        <br />
smcdrcAuthor Commented:
Here is the master.vb file:

Imports WPLData
Imports System.Configuration.ConfigurationSettings
Imports System.Data
Imports OboutInc.EasyMenu_Pro
Imports OboutInc

Partial Class MainPage
    Inherits System.Web.UI.MasterPage 'OboutInc.oboutAJAXMasterPage '

    Dim mydata As WplData
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    End Sub
    Private Sub CreateEasyMenu()
        Dim dtMenu As DataTable

        Dim StyleFolder As String = ""
        Dim IconsFolder As String = ""

        mydata = New WplData("Server=WOLV-DB1;integrated security=SSPI;database=WPLCO;trusted_connection=Yes;") 'WplData(ConfigurationManager.ConnectionStrings("WPLCOconnection").ConnectionString)
        mydata.SetParameterValue("@MenuID", 1)
        dtMenu = mydata.ExecInstatiatedStoredProc()

        '/*** main menu - records with ParentId = 0 ***/
        Dim mainEM As EasyMenu = Nothing
        '/*** ***/

        '/*** list with child menus ***/
        Dim childMenus As Hashtable = Nothing
        For Each row As DataRow In dtMenu.Rows
            ' While oReader.Read()
            Dim Id As Int32 = Int32.Parse(row("ID"))
            Dim parentId As Int32 = Int32.Parse(row("ParentID"))
            Dim InnerHtml As String = row("InnerHtml").ToString().Trim()
            Dim HtmlLink As String
            If row("HtmlLink") Is Nothing Then
                HtmlLink = ""
                HtmlLink = row("HtmlLink").ToString().Trim()
            End If
            Dim level As Int32 = Int32.Parse(row("Level"))
            Dim icon As String
            If row("Icon") Is Nothing Then
                icon = ""
                icon = row("Icon").ToString().Trim()
            End If

            If (parentId = 0) Then

                If (mainEM Is Nothing) Then

                    mainEM = New EasyMenu() '
                    mainEM.ID = "mainEM" '
                    mainEM.Width = "781" '
                    mainEM.ShowEvent = MenuShowEvent.Always '
                    mainEM.StyleFolder = StyleFolder
                    mainEM.IconsFolder = IconsFolder
                    mainEM.IconsPosition = MenuIconsPosition.Left
                    mainEM.UseIcons = True
                    mainEM.Position = MenuPosition.Horizontal
                    ' mainEM.Position = MenuPosition.Vertical ''For Vertical alignment

                    '// css classes names for the menu and the item container
                    mainEM.CSSMenu = "ParentMenu" '
                    mainEM.Align = MenuAlign.Right
                    mainEM.CSSMenuItemContainer = "ParentItemContainer" '

                    '// css classes names for MenuItems
                    Dim MenuItemCssClasses As CSSClasses = mainEM.CSSClassesCollection(mainEM.CSSClassesCollection.Add(New CSSClasses(GetType(OboutInc.EasyMenu_Pro.MenuItem)))) '
                    MenuItemCssClasses.ComponentSubMenuCellOver = "ParentItemSubMenuCellOver"
                    MenuItemCssClasses.ComponentContentCell = "ParentItemContentCell" '
                    MenuItemCssClasses.Component = "ParentItem" '
                    MenuItemCssClasses.ComponentSubMenuCell = "ParentItemSubMenuCell" '
                    MenuItemCssClasses.ComponentIconCellOver = "ParentItemIconCellOver" '
                    MenuItemCssClasses.ComponentIconCell = "ParentItemIconCell" '
                    MenuItemCssClasses.ComponentOver = "ParentItemOver" '
                    MenuItemCssClasses.ComponentContentCellOver = "ParentItemContentCellOver" '
                    '// add the classes names to the collection
                    mainEM.CSSClassesCollection.Add(MenuItemCssClasses) '

                    '// css classes names for MenuSeparators
                    Dim MenuSeparatorCssClasses As CSSClasses = mainEM.CSSClassesCollection(mainEM.CSSClassesCollection.Add(New CSSClasses(GetType(MenuSeparator))))
                    MenuSeparatorCssClasses.ComponentSubMenuCellOver = "ParentSeparatorSubMenuCellOver" '
                    MenuSeparatorCssClasses.ComponentContentCell = "ParentSeparatorContentCell" '
                    MenuSeparatorCssClasses.Component = "ParentSeparator" '
                    MenuSeparatorCssClasses.ComponentSubMenuCell = "ParentSeparatorSubMenuCell" '
                    MenuSeparatorCssClasses.ComponentIconCellOver = "ParentSeparatorIconCellOver" '
                    MenuSeparatorCssClasses.ComponentIconCell = "ParentSeparatorIconCell" '
                    MenuSeparatorCssClasses.ComponentOver = "ParentSeparatorOver" '
                    MenuSeparatorCssClasses.ComponentContentCellOver = "ParentSeparatorContentCellOver" '
                    '// add the classes names to the collection
                    mainEM.CSSClassesCollection.Add(MenuSeparatorCssClasses) '
                End If

                mainEM.AddItem(New OboutInc.EasyMenu_Pro.MenuItem("item_" + Id.ToString(), InnerHtml.Trim(), icon, HtmlLink, "", "")) '



                If (childMenus Is Nothing) Then
                    childMenus = New Hashtable() '
                End If
                '/* first time the menu is ceated */
                If Not (childMenus.ContainsKey(parentId)) Then

                    Dim childEM As EasyMenu = New EasyMenu()
                    childEM.ID = "childEM_" + parentId.ToString() '
                    childEM.StyleFolder = StyleFolder
                    childEM.IconsFolder = IconsFolder
                    childEM.UseIcons = True
                    childEM.IconsPosition = MenuIconsPosition.Right

                    childEM.ShowEvent = MenuShowEvent.MouseOver '
                    childEM.AttachTo = "item_" + parentId.ToString() '
                    childEM.Width = "150" '
                    'childEM.Align = MenuAlign.Right ''For Vertical alignment
                    childEM.Align = MenuAlign.Under
                    Dim menuLevel As Int32 = level
                    If (menuLevel = 1) Then
                        childEM.Align = MenuAlign.Under
                        childEM.Align = MenuAlign.Left
                    End If

                    childEM.AddItem(New OboutInc.EasyMenu_Pro.MenuItem("item_" + Id.ToString(), InnerHtml, icon, HtmlLink, "", "")) '

                    childMenus.Add(parentId, childEM) '

                    Me.Controls.Add(childEM) '

                    '/* items are added to the already created menu */

                    'Dim childEM As EasyMenu = New EasyMenu() '(EasyMenu)childMenus[parentId];
                    Dim childEM As EasyMenu = childMenus(parentId)
                    childEM.Align = MenuAlign.Under ''For Vertical alignment
                    childEM.AddItem(New OboutInc.EasyMenu_Pro.MenuItem("item_" + Id.ToString(), InnerHtml, icon, HtmlLink, "", "")) '
                End If
            End If
            'End While
        'oReader.Close() '
        'Cn.Close() '

    End Sub
End Class
>Me.Controls.Add(childEM) '

You appear to be adding the child menu items to the master page without inserting them into the correct place.  Do they not belong in the master menu?

smcdrcAuthor Commented:
This works just fine, if the child page has less code in it.  Is something I can change about response size?  
smcdrcAuthor Commented:
I thought about what you said.  Me, I am guessing, was referring to the page.  You need to add the controls to page, somewhere.  So I changed

Me.Controls.Add(childEM) '



Yes, the Me keyword refers to the instance of the class that it is within.  In this case the master page.

Glad you got it sorted.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.