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

Thread: Page_Load for template.ascx

  1. #1
    etessau2 is offline Junior Member
    Join Date
    Mar 2009
    Posts
    8

    Default Page_Load for template.ascx

    Is there a Page_Load type function for template.ascx? We want to show/hide things on the template throughout the site based on some logic, but there doesn't seem to be a defined code-behind page or inlined server script section for template.ascx

    For example, some main header and footer links will go away for anonymous users and some other user types.

    Thanks!

  2. #2
    jsimacek is offline Senior Member
    Join Date
    Dec 2008
    Location
    Phoenix, AZ
    Posts
    373

    Default

    Do you have source code? If you do, you can just make a placeholder and then in the Parser.cs just dynamically set the token based on the registered/logged in/out stati.

    Another way is to make alternated templates, and set those in the skinbase based on a similar logic of customer being logged in or not.
    Jan Simacek - Compunix, LLC
    AspDotNetStorefront trusted Devnet Partner and Reseller since 2005

    AspDotNetStorefront Mods and Add-Ons at http://www.ecommercecartmods.com/
    - Searching, Filtering and Sorting (like cSearch, Dealer Locator, Price Ranges, Blog)
    - Reports (like Cart Abandonment and Net Sales)
    - Customer Experience (like Question/Answers)
    - Site and Data Management (like Entity Product Mapper, Bulk Updaters, Make/Model/Year filters)

  3. #3
    sam.bengtson is offline Member
    Join Date
    Jan 2011
    Posts
    64

    Default

    I know this is getting to be a pretty old thread but I'm looking for the exact same thing. I do not have the source code and would like to create a codefile for template.ascx. Does anybody have any pointers? I've been struggling with this for a couple days