• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 615
  • Last Modified:

Response document is being truncated

First Question ever posted on here.!!!
I am developing an a home page in VB.net.  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.
0
smcdrc
Asked:
smcdrc
  • 5
  • 4
1 Solution
 
PaulHewsCommented:
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.
0
 
PaulHewsCommented:
pasting the markup = posting the markup
0
 
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Wolverine Pipe Line Company</title>
    <link href="../styles/wpl.css" rel="stylesheet" type="text/css" />
</head>
<body topmargin="0" leftmargin="0">
    <form id="form1" runat="server">
   
    <div>
        <table border="0" cellpadding="0" cellspacing="0">
        <tr><td>
            <img alt="Wolverine Pipe Line Company" src="../images/HeaderLogo.jpg" /></td></tr>
            <tr>
                <td>
                    <asp:PlaceHolder ID="ph1" runat="server"></asp:PlaceHolder>
                </td>
            </tr>
            <tr>
                <td> <asp:contentplaceholder id="MainBody" runat="server">
                     </asp:contentplaceholder>
                </td>
            </tr>
            <tr>
                <td>
                <!--Footer area -->
                </td>
            </tr>
        </table>
       
        <br />
       
    </div>
    </form>
  </body>
</html>
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
        CreateEasyMenu()
    End Sub
    Private Sub CreateEasyMenu()
        Dim dtMenu As DataTable

        Dim StyleFolder As String = "http://wpl.wolverine.com/EMStyles/styles/horizontal1"
        Dim IconsFolder As String = "http://wpl.wolverine.com/EMStyles/Icons"

        mydata = New WplData("Server=WOLV-DB1;integrated security=SSPI;database=WPLCO;trusted_connection=Yes;") 'WplData(ConfigurationManager.ConnectionStrings("WPLCOconnection").ConnectionString)
        mydata.InstantiateStoreProc("GetMenu")
        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 = ""
            Else
                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 = ""
            Else
                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, "", "")) '

                ph1.Controls.Add(mainEM)

            Else

                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
                    Else
                        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 */
                Else

                    '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
        Next
        'oReader.Close() '
        'Cn.Close() '


    End Sub
   
End Class
0
 
PaulHewsCommented:
>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?

mainEm.AddItem(childEM)
0
 
smcdrcAuthor Commented:
This works just fine, if the child page has less code in it.  Is something I can change about response size?  
0
 
PaulHewsCommented:
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) '
0
 
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) '

to

ph1.Controls.Add(childEM)

AND IT WORKS!!!
0
 
PaulHewsCommented:
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.

0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

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