Page 1 of 1

Add onother link to the same panel in the same page?

Posted: Tue Sep 23, 2008 2:17 am
by Odettes
Hi!

Can someone tell me how to add onother linkbutton in the page "OnePageCheckout.ascx" that have the same function as the original button? My problem is that I cant add onother "TargetControlID" to the ModalPopupExtender so i dont now how to add onother button that use the same popup.
Now you maybe wonder why I need 2 buttons on the same page that shows the Terms and Condition, I dont.
I have a couple of small pictures on the page and when you click one of them it bring upp the popup and you can view the pictures in full size.


Original:
<asp:LinkButton ID="ShowTCLink" runat="server" EnableViewState="false" Text="view the Terms and Conditions"></asp:LinkButton>

The button connect with this:
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server"
TargetControlID="ShowTCLink"
PopupControlID="TCDialog"
BackgroundCssClass="modalBackground"
OkControlID="AcceptTermsAndConditions"
OnOkScript="toggleTC(true)"
OnCancelScript="toggleTC(false)"
CancelControlID="DeclineTermsAndConditions"
DropShadow="true"
PopupDragHandleControlID="TCDialogHeader" />


Best regards, Thomas

Re: Add onother link to the same panel in the same page?

Posted: Thu Sep 25, 2008 2:15 am
by mazhar
Made a copy of the ShowTCLink button as below

Code: Select all

<asp:LinkButton ID="LB" runat="server" EnableViewState="false" Text="view the Terms and Conditions"></asp:LinkButton>
Now locate the TCDialog panel and create a copy of is as below

Code: Select all

<asp:Panel ID="LBDlg" runat="server" Style="display: none" CssClass="modalPopup">
                                            <asp:Panel ID="Panel2" runat="server" CssClass="modalPopupHeader">
                                                <div>
                                                    <p>Terms and Conditions:</p>
                                                </div>
                                            </asp:Panel>
                                            <div class="modalPopupText">
                                                <div class="modalPopupScroller">
                                                    <asp:Literal ID="Literal1" runat="server" EnableViewState="false"></asp:Literal>
                                                    <br /><br />
                                                    <div align="center">
                                                        <asp:LinkButton ID="LinkButton2" runat="server" EnableViewState="false" SkinID="Button" Text="I Decline"></asp:LinkButton>
                                                        <asp:LinkButton ID="LinkButton3" runat="server" EnableViewState="false" SkinID="Button" Text="I Accept"></asp:LinkButton>
                                                    </div><br />
                                                </div>
                                            </div>
                                            
                                        </asp:Panel>
Locate the and make copy of the ModalPopupExtender as below

Code: Select all

<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" 
                                            TargetControlID="LB"
                                            PopupControlID="LBDlg" 
                                            BackgroundCssClass="modalBackground" 
                                            OkControlID="AcceptTermsAndConditions"
                                            OnOkScript="toggleTC(true)"
                                            OnCancelScript="toggleTC(false)"
                                            CancelControlID="DeclineTermsAndConditions" 
                                            DropShadow="true"                                            
                                            PopupDragHandleControlID="LBDlg" />