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: ascx checking appconfigs

  1. #1
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default ascx checking appconfigs

    We currently have 4 different ascx pages for different parts of our site.

    What we want to do is have on one ascx page is specials that are controlled via app configs
    C#/VB.NET Code:
    c# code
    if (AppLogic.AppConfigBool("ShowSpecialOnShoppingCart"))
                {
                    
    string SpecialURL AppLogic.GetString("ShoppingCartSpecial.aspx.URL"ThisCustomer.SkinIDThisCustomer.LocaleSetting);
                    
    string SpecialTEXT AppLogic.GetString("ShoppingCartSpecial.aspx.Display"ThisCustomer.SkinIDThisCustomer.LocaleSetting);
                    
    Special.Text "<div style=\"text-align:center;padding:0;margin:0;\"><a href=\"" SpecialURL "\" title=\"Checkout Special\">" SpecialTEXT "</a></div>";
                    
    Special.Visible true;
                }
                else
                {
                    
    Special.Visible false;
                }

    aspx code
    <asp:Label ID="Special" runat="server" Visible="false" /> 
    Problem is I am not too sure how to get this to work, can anyone help?

    Thanks in advance.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  2. #2
    ZachJ85 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philadelphia, PA
    Posts
    99

    Default

    What doesn't work with it? Do you get into the True condition? If not, my first place to start is not trusting ShowSpecialOnShoppingCart as a bool. For testing check for a hard value like the word 'true' since you said it's a bool or you could keep it visible the entire time, just leave the label blank and update if it is true.

    Little more info on what is happening will help.

    When you debug do you get into the IF (true) and it just isn't showing? Is it not getting into the If (true)?


    Zach
    SQL 2008, Visual Studio 2010
    Source: C#
    Version: AspDotNetStorefront ML 8.0.1.1/8.0.1.1
    Framework: .Net 4.0 (Running)

  3. #3
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    It works in an aspx page just fine with no issues at all.

    The problem is to to do with the design. We need it in an ASCX page (template pages for ver 8) and that is where I am running into the issue on how to do it.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  4. #4
    ZachJ85 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philadelphia, PA
    Posts
    99

    Default

    Quote Originally Posted by e-tradecounter View Post
    It works in an aspx page just fine with no issues at all.

    The problem is to to do with the design. We need it in an ASCX page (template pages for ver 8) and that is where I am running into the issue on how to do it.
    Gotcha, the original post had ASCX written twice and got confused.
    SQL 2008, Visual Studio 2010
    Source: C#
    Version: AspDotNetStorefront ML 8.0.1.1/8.0.1.1
    Framework: .Net 4.0 (Running)

  5. #5
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    I'm not an expert at that sort of level. But it seems that .ascx pages don't do any of that kind of processing. You'd need to extract that out to an XML Package.
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!

  6. #6
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Ah good idea! Perfect, stick it in an XML and then use that in the template.

    Thanks!
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  7. #7
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    Oooh! I am an expert at that level
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!