Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 5 of 5

Thread: Simple product output?

  1. #1
    kernel64 is offline Member
    Join Date
    Mar 2009
    Posts
    45

    Default Simple product output?

    I have created a sample page Sample.aspx, now i want to print products which are saved in the database, must i use XmlPackages or is there an another way to print a test product?


    When i use a XmlPackage in my site like this:
    <aspdnsf:XmlPackage id="Package1" PackageName="rev.manufacturers.xml.config" runat="server" />

    Then i get an error:
    Object reference not set to an instance of an object.

    Line 60: using (XmlPackage2 m_P = new XmlPackage2(PackageName, ThisCustomer, ThisCustomer.SkinID, String.Empty, RuntimeParams, String.Empty, true))

    Source File: c:\DEV_Main\AspDotNetStorefront\Web\XmlPackageCont rol.ascx.cs Line: 60
    My Page is in the same directory like the other pages, whats the problem??

  2. #2
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Does your Sample.aspx code-behind page inherit from the SkinBase class? You must inherit from this class in order to use the XmlPackage engine.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  3. #3
    kernel64 is offline Member
    Join Date
    Mar 2009
    Posts
    45

    Default

    Yes it inherit from SkinBase:

    Code:
    public partial class test : SkinBase
    I copied the default.aspx and renamed it to test.aspx, all codebehind exist from the page.

    ASPX:

    Code:
    <%@ Page Language="c#" Inherits="AspDotNetStorefront.test" CodeFile="test.aspx.cs" %>
    <%@ Register TagPrefix="aspdnsf" TagName="XmlPackage" src="XmlPackageControl.ascx" %>
    <%@ Register TagPrefix="aspdnsf" TagName="Topic" Src="TopicControl.ascx" %>
    
           
    <form>
    
    <aspdnsf:Topic ID="IDName" runat="server" TopicName="about" /> 
     <aspdnsf:Topic runat="server" ID="HeaderMsg" TopicName="CartPageHeader" />
    <aspdnsf:XmlPackage id="Packasdfsdge1" PackageName="rev.manufacturers.xml.config" runat="server" />
    
    </form>

    Where is the bug ?
    Last edited by kernel64; 05-27-2009 at 05:18 AM.

  4. #4
    kernel64 is offline Member
    Join Date
    Mar 2009
    Posts
    45

    Default

    The null error is in the XmlPackageControl.ascx, the variable ThisCustomer is null, thats why i get that error.
    Can you help me to solve this problem, i copied the same content from the bestsellers.aspx which is function, but in my page test.aspx i get these errror.
    My class is inherited from SkinBase.

  5. #5
    Ryan is offline Junior Member
    Join Date
    Aug 2006
    Posts
    26

    Default

    Make sure you have Packasdfsdge1.SetContext = this; on the page load event.