2012-04-19 8 views
0

新しいポップアップウィンドウが開きますが、ログインページにリダイレクトされ、正しいパスワードを表示してもログインできません。要件:ログイン後、ブラウザにBACKボタンを表示しないでポップアップウィンドウが必要です。ユーザーログイン(ログインコントロール)後に新しいウィンドウを開くには?

<asp:Content ID="LoginContent" ContentPlaceHolderID="LoginContent" runat="server"> 
     <asp:UpdatePanel ID="LoginUpdatePanel" runat="server" UpdateMode="Conditional"> 
     <ContentTemplate> 
      <asp:Panel Width="100%" runat="server" ID="LoginPanel" HorizontalAlign="Center" DefaultButton="MainLogin$LoginButton"> 
       <asp:Label ID="LoginMessageValue" runat="server"></asp:Label> 
       <asp:Login RememberMeSet="false" ID="MainLogin" OnLoggedIn="MainLogin_LoggedIN" OnAuthenticate="Login_Click" runat="server" SkinID="standardLoginObject" EnableTheming="True" 
        TextBoxStyle-Width="150px" DisplayRememberMe="false"> 
       </asp:Login> 
      </asp:Panel> 
     </ContentTemplate> 
    </asp:UpdatePanel> 
</asp:Content> 

背後にあるコード:

Protected Sub Login_Click(ByVal sender As Object, ByVal e As System.EventArgs) 
     'OnAuthenticate = "Login_Click" 
     ' ScriptManager.RegisterClientScriptBlock(Me.Page, Me.GetType, "error", "window.open('~/workflow/Worklist2.aspx', 'mywindow', 'status=1,toolbar=0');", True) 
     Try 
      Common.UserObject = System.Web.Security.Membership.GetUser(MainLogin.UserName) 

      Dim _userID As Integer = Common.UserObject.ProviderUserKey 
      Common.InitializeSession(_userID, nameSpaceURI) 
      Dim _role() As String = System.Web.Security.Roles.GetRolesForUser(Common.UserObject.UserName) 
      If _role.Length = 0 Then 
       Common.ClearSession() 
       Response.Redirect(ConfigurationManager.AppSettings("LoginPath"), False) 
       'MainLogin.FailureText = "Please contact the customer service to review your account setup." 
       'ClientScript.RegisterClientScriptBlock(Page.GetType, "Error", "alert('Please contact the customer service to review your account setup.')", True) 
      End If 
      ScriptManager.RegisterClientScriptBlock(Me.Page, Me.GetType, "success", "window.open('../workflow.aspx', 'mywindow', 'status=1,toolbar=0'); window.resizeTo(screen.availWidth,screen.availHeight); window.moveTo(0,0); ", True) 
     Catch ex As Exception 
      SaveException(ex) 
     End Try 
    End Sub 

答えて

0

私はあなたの本当の問題は、あなたもそれを見るために認証されることをユーザーに要求するエラーページを表示しようとしているということだと思います。

エラーページを一般公開されている場所に移動する必要があります。

あなたのweb.configファイルでこの動作を指定することができます。

<configuration> 
    <location path="~/errorpage.aspx"> 
     <system.web> 
     <authorization> 
      <allow users="?"/> 
     </authorization> 
     </system.web> 
    </location> 
</configuration> 
関連する問題