BV Commerce Forum
»
BV Commerce Support
»
General Support
»
Comments do not hide... How do I remove/hide page object with out conflict.
Rank: Member
Joined: 8/25/2007(UTC) Posts: 124
|
How can I hide this information on a Custom Category Template -- Category.aspx
<div class="recordsku"> <a id="SkuAnchor" runat="server" href=""></a> </div>
When I comment out the page still shows in Firefox. IE7 hides it, but firefox still show the end comment brackets. -->
<!-- <div class="recordsku"> --> <!-- <a id="SkuAnchor" runat="server" href=""></a> --> <!-- </div> -->
When I remove the entire code block I get:
<H2>Object reference not set to an instance of an object. </H2>[color=#ffffcc>
[tr ][td ]<CODE>[/code] Line]Line 120: Dim SkuAnchor As HtmlAnchor = DirectCast(e.Item.FindControl("SkuAnchor"), HtmlAnchor) Line 121: SkuAnchor.HRef = destinationLink [/color]Line 122: SkuAnchor.InnerText = p.Sku Line 123:</PRE>[/td][/tr]</TABLE>
What are my options here... I do not want the SKU shown on the category page. Any help is appreciated.
|
|
|
|
Rank: Member
Joined: 12/23/2003(UTC) Posts: 909
|
take the comments out.
<div class="recordsku"> ---> <div class="recordsku" visible="False">
or
<a id="SkuAnchor" runat="server" href="" visible="false></a>
or in stylesheet:
.recordsku {display: none;}
I suggest doing it in the stylesheet as with any upgrade, your page code changes stand the chance of being overwritten. |
|
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
Another option is to wrap the block you want to hide with an PlaceHolder control like this: Code: <asp:PlaceHolder Visible="False" runat="server"> ...code you want to hide </asp:PlaceHolder>
|
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 8/25/2007(UTC) Posts: 124
|
Thank you so much for the help. I will give these a shot. I was stuck in the mud!
|
|
|
|
Rank: Member
Joined: 8/25/2007(UTC) Posts: 124
|
<a id="SkuAnchor" runat="server" href="" visible="false></a>
Creates the following error
Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Cannot create an object of type 'System.Boolean' from its string representation '"false' for the 'Visible' property.
Source Error:
Line 41: </div> Line 42: Line 43: <a id="SkuAnchor" runat="server" href="" visible="false></a> Line 44: Line 45:
Source File: /bvc5/BVModules/CategoryTemplates/BHS Grid with Subs/Category.aspx Line: 43
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
|
|
|
|
Rank: Member
Joined: 8/25/2007(UTC) Posts: 124
|
<div class="recordsku"> ---> <div class="recordsku" visible="False">
Creates the following Error
Server Error in '/bvc5' Application.
Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 119: Line 120: Dim SkuAnchor As HtmlAnchor = DirectCast(e.Item.FindControl("SkuAnchor"), HtmlAnchor) Line 121: SkuAnchor.HRef = destinationLink Line 122: SkuAnchor.InnerText = p.Sku Line 123:
Source File: e:\builders-web\BV Commerce 5\BVModules\CategoryTemplates\BHS Grid with Subs\Category.aspx.vb Line: 121
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] BVModules_CategoryTemplates_Grid_with_Subs_Category.DataList1_ItemDataBound(Object sender, DataListItemEventArgs e) in e:\builders-web\BV Commerce 5\BVModules\CategoryTemplates\BHS Grid with Subs\Category.aspx.vb:121 System.Web.UI.WebControls.DataList.OnItemDataBound(DataListItemEventArgs e) +8670790 System.Web.UI.WebControls.DataList.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +137 System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) +459 System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +54 System.Web.UI.WebControls.BaseDataList.DataBind() +55 BVModules_CategoryTemplates_Grid_with_Subs_Category.PageLoad(Object sender, EventArgs e) in e:\builders-web\BV Commerce 5\BVModules\CategoryTemplates\BHS Grid with Subs\Category.aspx.vb:43 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
|
|
|
|
Rank: Member
Joined: 8/25/2007(UTC) Posts: 124
|
This worked!
<asp:PlaceHolder Visible="False" runat="server" <div class="recordsku"> <a id="SkuAnchor" runat="server" href=""></a> </div> </asp:PlaceHolder>
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.