サード パーティの Web サイトのログイン ページを、開発中の別の Web サイトの iframe に配置する必要があります。ユーザーがログインしたときにiframeから抜け出すためにJavaScriptを追加する必要がありますが、ログインボタンを作成してJavaScriptを実行し、ログインのポストバックを行うことはできません-どちらかだけです.
これは、私が適応しようとしているiframe'dログインページのコードです。
<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
<asp:Login ID="Login1" runat="server" OnAuthenticate="Login1_Authenticate">
<LayoutTemplate>
<asp:Label ID="lblUsername" runat="server" AssociatedControlID="Username" Text="Email" />
<asp:TextBox ID="Username" runat="server" Text="myName" />
<asp:Label ID="lblPassword" runat="server" AssociatedControlID="Password" Text="Password" />
<asp:TextBox ID="Password" runat="server" Text="myPassword" />
<asp:ImageButton ID="btnLogin" runat="server" CommandName="Login" ImageUrl="~/Images/login-submit.gif" AlternateText="Login" OnClientClick="top.location.href = document.location.href; return true;" />
</LayoutTemplate>
</asp:Login>
</AnonymousTemplate>
<LoggedInTemplate>
You are currently logged in blurb..
</LoggedInTemplate>
現在、ログイン ボタンをクリックすると、ログイン ページが iframe から外れますが、もう一度ボタンをクリックしてユーザーをログインさせる必要があります。ありがとう。