SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do i call an external webpage in a popup panel

    Hello,

    Am using the modal popup sample shown here

    http://www.asp.net/learn/ajax-videos/video-85.aspx



    I modified the code, to allow an external iframe as below.

    My question is : how do i call an external web page in the popup window, ie in the iframe ?



    <asp:Panel ID="Panel10" runat="server">
    </asp:Panel>
    <asp:Panel ID="Panel1" runat="server" Style="display: none" Width="40%" Height="550" BorderWidth="4" BorderColor="Silver" BackColor="White" BorderStyle="Solid">
    <asp:Button ID="OkButton" runat="server" Text="OK" onclick="Button1_Click" />
    <asp:Button ID="CancelButton" runat="server" Text="Cancel" />
    <iframe align="center" frameborder="0" width="40%" height="550" name="I1"
    scrolling="no" id="I1"></iframe>
    <div align="center">
    </div>
    </asp:Panel>



    Before I used this method, i was running this script



    <script language="javascript">
    function doPayment(amount,trnxID)
    {
    var trnxId = trnxID;
    var cadpid = '7';
    var mertId = '000';
    var amount = amount;
    var url = 'https://www.externalpage.com/purchase.aspx';

    var fullUrl = url +
    "?CADPID="+cadpid+"&MERTID="+mertId+"&TXNREF="+trnxId+"&AMT="+amount+"&TRANTYPE=00";

    document.getElementById("PayFrame").src = fullUrl;

    }
    </script>

  2. #2
    SitePoint Guru pufa's Avatar
    Join Date
    Oct 2004
    Location
    Portugal, Lisboa
    Posts
    947
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's PayFrame??
    Ciao, Rui...

  3. #3
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here is the full code



    <&#37;@ Page Language="C#" AutoEventWireup="true" CodeFile="1.aspx.cs" Inherits="shop_1" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    <head runat="server">
    <title></title>
    </head>
    <script language="javascript">
    function doPayment(amount, trnxID) {
    var trnxId = trnxID;
    var cadpid = 'C7';
    var mertId = 'G1000';
    var amount = amount;
    var url = 'https://www.myexternalurl.com/default.aspx';
    //Pilot URL
    var fullUrl = url +
    "?CADPID=" + cadpid + "&MERTID=" + mertId + "&TXNREF=" + trnxId + "&AMT=" + amount + "&TRANTYPE=00";
    //alert(fullUrl);<body id = "sthebody" runat="server"></body>
    document.getElementById("PayFrame").src = fullUrl;
    //showWindow(fullUrl); //function in WebPAY_PopUp_Caller.txt
    }
    </script>
    <body>
    <form id="form1" runat="server">
    <div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <ajaxtoolkit:modalpopupextender ID="MPE" runat="server"
    TargetControlID="LinkButton1"
    PopupControlID="Panel1"
    BackgroundCssClass="modalBackground"
    DropShadow="true"
    OkControlID="OkButton"
    OnOkScript="onOk()"
    CancelControlID="CancelButton"
    PopupDragHandleControlID="Panel3" />
    </div>
    <asp:Panel ID="Panel10" runat="server">
    </asp:Panel>
    <asp:Panel ID="Panel1" runat="server" Style="display: none" Width="40%" Height="550" BorderWidth="4" BorderColor="Silver" BackColor="White" BorderStyle="Solid">
    <asp:Button ID="OkButton" runat="server" Text="OK" onclick="Button1_Click" />
    <asp:Button ID="CancelButton" runat="server" Text="Cancel" />
    <iframe align="center" frameborder="0" width="40%" height="550" name="I1"
    scrolling="no" id="I1" runat="server"></iframe>
    <div align="center">
    </div>
    </asp:Panel>
    <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">LinkButton</asp:LinkButton>
    </form>
    </body>
    </html>

  4. #4
    SitePoint Guru pufa's Avatar
    Join Date
    Oct 2004
    Location
    Portugal, Lisboa
    Posts
    947
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Again!! What is PageFrame in "document.getElementById("PayFrame").src = fullUrl"

    Turn Javascript debugging on... and you will see...
    Ciao, Rui...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •