smcdrc
asked on
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.
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.
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
ASKER
Here is the .master page.
_____________________
<%@ Master Language="VB" CodeFile="MainPage.master. vb" Inherits="MainPage" %>
<%@ Register Assembly="obout_EasyMenu_P ro" Namespace="OboutInc.EasyMe nu_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:Place Holder>
</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>
_____________________
<%@ Master Language="VB" CodeFile="MainPage.master.
<%@ Register Assembly="obout_EasyMenu_P
<!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.
<tr>
<td>
<asp:PlaceHolder ID="ph1" runat="server"></asp:Place
</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>
ASKER
Here is the master.vb file:
_________________________
Imports WPLData
Imports System.Configuration.Confi gurationSe ttings
Imports System.Data
Imports OboutInc.EasyMenu_Pro
Imports OboutInc
Partial Class MainPage
Inherits System.Web.UI.MasterPage 'OboutInc.oboutAJAXMasterP age '
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;i ntegrated security=SSPI;database=WPL CO;trusted _connectio n=Yes;") 'WplData(ConfigurationMana ger.Connec tionString s("WPLCOco nnection") .Connectio nString)
mydata.InstantiateStorePro c("GetMenu ")
mydata.SetParameterValue(" @MenuID", 1)
dtMenu = mydata.ExecInstatiatedStor edProc()
'/*** 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().Tri m()
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.CSSMenuItemContaine r = "ParentItemContainer" '
'// css classes names for MenuItems
Dim MenuItemCssClasses As CSSClasses = mainEM.CSSClassesCollectio n(mainEM.C SSClassesC ollection. Add(New CSSClasses(GetType(OboutIn c.EasyMenu _Pro.MenuI tem)))) '
MenuItemCssClasses.Compone ntSubMenuC ellOver = "ParentItemSubMenuCellOver "
MenuItemCssClasses.Compone ntContentC ell = "ParentItemContentCell" '
MenuItemCssClasses.Compone nt = "ParentItem" '
MenuItemCssClasses.Compone ntSubMenuC ell = "ParentItemSubMenuCell" '
MenuItemCssClasses.Compone ntIconCell Over = "ParentItemIconCellOver" '
MenuItemCssClasses.Compone ntIconCell = "ParentItemIconCell" '
MenuItemCssClasses.Compone ntOver = "ParentItemOver" '
MenuItemCssClasses.Compone ntContentC ellOver = "ParentItemContentCellOver " '
'// add the classes names to the collection
mainEM.CSSClassesCollectio n.Add(Menu ItemCssCla sses) '
'// css classes names for MenuSeparators
Dim MenuSeparatorCssClasses As CSSClasses = mainEM.CSSClassesCollectio n(mainEM.C SSClassesC ollection. Add(New CSSClasses(GetType(MenuSep arator))))
MenuSeparatorCssClasses.Co mponentSub MenuCellOv er = "ParentSeparatorSubMenuCel lOver" '
MenuSeparatorCssClasses.Co mponentCon tentCell = "ParentSeparatorContentCel l" '
MenuSeparatorCssClasses.Co mponent = "ParentSeparator" '
MenuSeparatorCssClasses.Co mponentSub MenuCell = "ParentSeparatorSubMenuCel l" '
MenuSeparatorCssClasses.Co mponentIco nCellOver = "ParentSeparatorIconCellOv er" '
MenuSeparatorCssClasses.Co mponentIco nCell = "ParentSeparatorIconCell" '
MenuSeparatorCssClasses.Co mponentOve r = "ParentSeparatorOver" '
MenuSeparatorCssClasses.Co mponentCon tentCellOv er = "ParentSeparatorContentCel lOver" '
'// add the classes names to the collection
mainEM.CSSClassesCollectio n.Add(Menu SeparatorC ssClasses) '
End If
mainEM.AddItem(New OboutInc.EasyMenu_Pro.Menu Item("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(pa rentId)) 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.Menu Item("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[pare ntId];
Dim childEM As EasyMenu = childMenus(parentId)
childEM.Align = MenuAlign.Under ''For Vertical alignment
childEM.AddItem(New OboutInc.EasyMenu_Pro.Menu Item("item _" + Id.ToString(), InnerHtml, icon, HtmlLink, "", "")) '
End If
End If
'End While
Next
'oReader.Close() '
'Cn.Close() '
End Sub
End Class
_________________________
Imports WPLData
Imports System.Configuration.Confi
Imports System.Data
Imports OboutInc.EasyMenu_Pro
Imports OboutInc
Partial Class MainPage
Inherits System.Web.UI.MasterPage 'OboutInc.oboutAJAXMasterP
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;i
mydata.InstantiateStorePro
mydata.SetParameterValue("
dtMenu = mydata.ExecInstatiatedStor
'/*** 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(
Dim HtmlLink As String
If row("HtmlLink") Is Nothing Then
HtmlLink = ""
Else
HtmlLink = row("HtmlLink").ToString()
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().Tri
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.CSSMenuItemContaine
'// css classes names for MenuItems
Dim MenuItemCssClasses As CSSClasses = mainEM.CSSClassesCollectio
MenuItemCssClasses.Compone
MenuItemCssClasses.Compone
MenuItemCssClasses.Compone
MenuItemCssClasses.Compone
MenuItemCssClasses.Compone
MenuItemCssClasses.Compone
MenuItemCssClasses.Compone
MenuItemCssClasses.Compone
'// add the classes names to the collection
mainEM.CSSClassesCollectio
'// css classes names for MenuSeparators
Dim MenuSeparatorCssClasses As CSSClasses = mainEM.CSSClassesCollectio
MenuSeparatorCssClasses.Co
MenuSeparatorCssClasses.Co
MenuSeparatorCssClasses.Co
MenuSeparatorCssClasses.Co
MenuSeparatorCssClasses.Co
MenuSeparatorCssClasses.Co
MenuSeparatorCssClasses.Co
MenuSeparatorCssClasses.Co
'// add the classes names to the collection
mainEM.CSSClassesCollectio
End If
mainEM.AddItem(New OboutInc.EasyMenu_Pro.Menu
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(pa
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.Menu
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[pare
Dim childEM As EasyMenu = childMenus(parentId)
childEM.Align = MenuAlign.Under ''For Vertical alignment
childEM.AddItem(New OboutInc.EasyMenu_Pro.Menu
End If
End If
'End While
Next
'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?
mainEm.AddItem(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)
ASKER
This works just fine, if the child page has less code in it. Is something I can change about response size?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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!!!
Me.Controls.Add(childEM) '
to
ph1.Controls.Add(childEM)
AND IT WORKS!!!
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.
Glad you got it sorted.