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 7 of 7

Thread: How to insert a token into a .aspx page in older version of ADNSF?

  1. #1
    sguptaet is offline Junior Member
    Join Date
    Aug 2012
    Posts
    5

    Default How to insert a token into a .aspx page in older version of ADNSF?

    I know how to insert into .ascx, but it simply displays the token code as text in .aspx. I'm trying to use topic tokens in a custom page home.aspx.

    This is an older version, and I'm not even sure which version. But it uses the older style token like this:
    Code:
    (!Topic Name="xxx"!)
    I've searched around, and I found these:

    http://forums.aspdotnetstorefront.co...ht=token+.aspx
    This gives some hints, but couldn't figure it out.

    http://forums.aspdotnetstorefront.co...-content-pages
    When I tried this, it now uses the standard skin's template file - which I don't want. The home.aspx page has a totally different look.

    In case you're wondering, I've already tried doing creating a new home template, which doesn't work. Long story... I just want to insert tokens into .aspx files for now.

  2. #2
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    First you need to register the topic control at the top of your .aspx page:

    Code:
    <%@ Register TagPrefix="aspdnsf" TagName="Topic" Src="TopicControl.ascx" %>
    Then use it like this:

    Code:
    <aspdnsf:Topic runat="server" ID="WhateverYouWantToCallIt" TopicName="TheNameOfYourTopic" />
    Check out shoppingcart.aspx for examples if need be...unless you're on a really ancient version, that page'll have several of these.

  3. #3
    sguptaet is offline Junior Member
    Join Date
    Aug 2012
    Posts
    5

    Default

    Quote Originally Posted by AspDotNetStorefront Staff - Scott View Post
    First you need to register the topic control at the top of your .aspx page:

    Code:
    <%@ Register TagPrefix="aspdnsf" TagName="Topic" Src="TopicControl.ascx" %>
    Then use it like this:

    Code:
    <aspdnsf:Topic runat="server" ID="WhateverYouWantToCallIt" TopicName="TheNameOfYourTopic" />
    Check out shoppingcart.aspx for examples if need be...unless you're on a really ancient version, that page'll have several of these.
    Hi Scott! Thanks for the reply. Today I didn't have time, I'm hoping tomorrow night I can try your solution. I'll let you know...

  4. #4
    sguptaet is offline Junior Member
    Join Date
    Aug 2012
    Posts
    5

    Default

    Actually, want to get this fixed so tried it now. In the shoppingcart.aspx it had this:
    Code:
    <%@ Page Language="c#" Inherits="InterpriseSuiteEcommerce.ShoppingCartPage" CodeFile="ShoppingCart.aspx.cs" ValidateRequest ="false" %>
    <%@ Register TagPrefix="ise" Namespace="InterpriseSuiteEcommerceControls" Assembly="InterpriseSuiteEcommerceControls" %>
    <%@ Register TagPrefix="ise" TagName="Topic" Src="TopicControl.ascx" %>
    <%@ Register TagPrefix="ise" TagName="XmlPackage" Src="XmlPackageControl.ascx" %>
    I copied the last 3 lines of this into the top of the home.aspx file:
    Code:
    <%@ Register TagPrefix="ise" Namespace="InterpriseSuiteEcommerceControls" Assembly="InterpriseSuiteEcommerceControls" %>
    <%@ Register TagPrefix="ise" TagName="Topic" Src="TopicControl.ascx" %>
    <%@ Register TagPrefix="ise" TagName="XmlPackage" Src="XmlPackageControl.ascx" %>
    Then I copied the topic token from shoppingcart.aspx and replaced the attributes to suit my own topic:
    Code:
    <ise:Topic runat="server" ID="testsun" TopicName="sun" />
    In the browser, when I load the page, where the token is, I get this error:
    Exception=Object reference not set to an instance of an object.

  5. #5
    sguptaet is offline Junior Member
    Join Date
    Aug 2012
    Posts
    5

    Default

    Still stuck on this... any clues/hints are appreciated!

  6. #6
    donttryathome is offline Senior Member
    Join Date
    Apr 2009
    Posts
    171

    Default

    I think the code inside the shoppingcart.aspx should only be used as an example, a starting point of reference.

    Add this line to the top of your home.aspx file:

    Code:
    <%@ Register TagPrefix="aspdnsf" TagName="Topic" Src="TopicControl.ascx" %>
    Then add this line inside the file to use it:

    Code:
    <aspdnsf:Topic runat="server" ID="testsun" TopicName="sun" />
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2

  7. #7
    sguptaet is offline Junior Member
    Join Date
    Aug 2012
    Posts
    5

    Default

    I'm getting the same error printing on the website:
    Exception=Object reference not set to an instance of an object.
    Do I need a home.aspx.cs file? If so, what is supposed to go in there?