当在页面上单击按钮时,我正在尝试更新 iFrame 的源。然而,似乎什么都没有发生……
.ASPX:
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
        <ContentTemplate>
                <div class="accountInfo">
                    <p class="submitButton">
                        <asp:Button ID="ValidateButton" runat="server" Text="Validate" OnClick="SubmitSponsor" />
                    </p>
                </div>
                <iframe runat="server" id="PayPalFrame" height="150px" width="100%" frameborder="0"></iframe>
        </ContentTemplate>
    </asp:UpdatePanel>
代码背后:
    protected void SubmitSponsor(object sender, EventArgs e)
    {
        var driver = new Driver();
        var isvalid = driver.IsAppValid(URL.Text, APILINK, Connstring);
        if (isvalid)
        {
            PayPalFrame.Attributes.Add("src", "http://www.google.com");
            URLInvalid.Visible = false;
        }
    }
我也试过:
PayPalFrame.Attributes["src"] = "http://www.google.com";仍然没有。