Search code examples
c#ablecommerce

Change one scriptlet display from a separate scriptlet


Fair warning: I don't understand half of what I know about this and I don't know that much so please forgive any terms misused or explanations unclear while I'm learning.

I am working on an ecommerce store application. It has an App_Themes with my theme and under that are Scriptlets - header, footer, content, sidebar, etc.

One of those is a Header with the store logo, etc. Another is the content (of the receipt page in this case).

When a button is clicked on the receipt page I want to set the header scriptlet to go away. I was thinking a CSS display:none but can't figure out how to address that part in another scriptlet. I am not married to that idea either.

I can't directly address controls in a separate scriptlet, apparently.

Some code-ish examples.

Header:

!-- Store Banner-->
<div id="PageBanner">
    <div id="PageBannerLogo">
        [[ConLib:Custom/StoreLogo]]
    </div>
</div>

[[ConLib:Custom/SwitchMobile]]

Content:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ReceiptPageInvoice.ascx.cs" Inherits="ConLib_Custom_ReceiptPage" %>
<%--
<conlib>
<summary>Display page to show details of an order like order items, shipping address, billing address etc.</summary>
<param name="AllowAddNote" default="true">If true, the customer can add notes to the order.  If false, the customer can only see notes added by the merchant.</param>
<param name="HandleFailedPayments" default="false">If true, the customer is redirected to an order payment page if the payment fails at checkout.</param>
</conlib>
--%>

<script src="js/showHide.js"></script>
<%--Scrolls address bar out of the way on iphones.
<script type="application/x-javascript">
addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);

function hideURLbar(){
window.scrollTo(0,1);
}
</script>--%>


<%@ Register Src="~/ConLib/OrderTotalSummary.ascx" TagName="OrderTotalSummary" TagPrefix="uc" %>
<%@ Register Src="~/ConLib/BreadCrumbs.ascx" TagName="BreadCrumbs" TagPrefix="uc" %>
<%@ Register Src="~/ConLib/Custom/OrderItemDetail.ascx" TagName="OrderItemDetail"
    TagPrefix="uc" %>
<%@ Register Src="~/ConLib/Utility/PayPalPayNowButton.ascx" TagName="PayPalPayNowButton"
    TagPrefix="uc" %>
<%-- this file is identical to ~/ConLib/MyOrderPage.ascx, with the addition of the affiliate tracker tag --%>
<%@ Register Src="~/Checkout/AffiliateTracker.ascx" TagName="AffiliateTracker" TagPrefix="uc" %>
<asp:PlaceHolder runat="server" ID="ReceiptPagePh" Visible="True">
    <asp:Panel runat="server" ID="InvoicePageTopPnl">
    <asp:PlaceHolder ID="BalanceDuePanel" runat="server" Visible="false" EnableViewState="false">
        <br/>
        <asp:Label ID="BalanceDueMessage" runat="server" Text="** Your order has a balance of {0:lc} due.&nbsp&nbsp;<a href='{1}'><u>Pay Now</u></a>"
                   SkinID="ErrorCondition"></asp:Label>
        <br/>
        <br/>
    </asp:PlaceHolder>  

More of the Program....

The button I want to hide the header:

<asp:Button runat="server" ID="ShowTicketButton" OnClick="ShowTicketButton_Click" Text="Show Ticket" />

Skipping from one scriptlet to another is new to me. Within a single conlib is no problems but having a button in one change appearance of another is different. This is a level I've not reached.

Any help is much appreciated. Jim


Solution

  • Wow, never saw no bites on SO. Probably because I was thinking about it ineffectively. My solution was to simply create a new layout scriptlet that had no header/footer and remove the breadcrumbs conlib from the content scriptlet. Now if we need a header I can just load it into the page and show and hide it at will. Thanks to all who looked at this... I know it's a weird one.