• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

dmcbrier
#1 Posted : Friday, March 20, 2009 8:33:24 AM(UTC)
dmcbrier

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.
Matt@9BallDesign
#2 Posted : Friday, March 20, 2009 9:03:09 AM(UTC)
Matt@9BallDesign

Rank: Member

Joined: 12/23/2003(UTC)
Posts: 909

take the comments out.

&lt;div class="recordsku"&gt; ---&gt; &lt;div class="recordsku" visible="False"&gt;

or

&lt;a id="SkuAnchor" runat="server" href="" visible="false&gt;&lt;/a&gt;

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.
Matt Martell


http://www.9balldesign.com - Web, Print, Graphic


http://www.martellhardware.com/ - Decorative &amp; Builder's Hardware

------------------------------------------------
Aaron
#3 Posted : Friday, March 20, 2009 11:52:46 AM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,393
United States
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
dmcbrier
#4 Posted : Tuesday, March 24, 2009 8:46:50 PM(UTC)
dmcbrier

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!
dmcbrier
#5 Posted : Friday, March 27, 2009 11:24:14 AM(UTC)
dmcbrier

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
dmcbrier
#6 Posted : Friday, March 27, 2009 11:25:33 AM(UTC)
dmcbrier

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
dmcbrier
#7 Posted : Friday, March 27, 2009 11:27:11 AM(UTC)
dmcbrier

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.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012