Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 3rd, 2006, 05:14 PM
Authorized User
 
Join Date: Jan 2006
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default Login Control behavior

I can't get the Login in the stuff below to hide on login....

It's a form with a UC that holds a vanilla Login Control

On LoggedIn, the UC raises an event that's intercepted by the parent page, which attempts to make the Login Control not visible.

Event is raised and intercepted fine, and the visible = false executes, but the page doesn't change appearance. This was the distillation of a more complex page/control set; but the "problem" happens right here in this very simple case.

I've done very similar things with UC's that didn't include a login control, they work fine.

I suspect it's the special nature of the Login Control, but I'm not sure what that might be....

 Any suggestions on what's happening here, why I can't hide the login control in this way, would be appreciated.

 Thanks!

===================== Page

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="a897_LoginUCtest.aspx.vb" Inherits="App_Pages_zzTest_a897_LoginUCtest" %>

<%@ Register Src="a8993_Login.ascx" TagName="a8993_Login" TagPrefix="uc1" %>

<!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" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <uc1:a8993_Login ID="A8993_Login1" runat="server" />
    </div>
    </form>
</body>
</html>
=============================== Code behind of page
Partial Class App_Pages_zzTest_a897_LoginUCtest
    Inherits System.Web.UI.Page
    Public Sub LogInComplete(ByVal sender As Object, _
      ByVal e As CommandEventArgs) Handles A8993_Login1.LogInComplete
        Me.A8993_Login1.Visible = False

    End Sub
End Class
=============================== UC
<%@ Control Language="VB" AutoEventWireup="false"
CodeFile="a8993_Login.ascx.vb" Inherits="a8993_Login" %>
<asp:Login ID="Login1" runat="server" Style="position: relative">
</asp:Login>
==================================Code Behind of UC

Partial Class a8993_Login
    Inherits System.Web.UI.UserControl
    Public Event LogInComplete As CommandEventHandler
    Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles Login1.LoggedIn
        Dim args As New CommandEventArgs("LogInComplete", "LogInComplete")
        RaiseEvent LogInComplete(Me, args)
    End Sub
End Class
====================================





Similar Threads
Thread Thread Starter Forum Replies Last Post
login control hastikeyvan ASP.NET 3.5 Basics 1 May 7th, 2008 04:47 AM
Login Control Behavior when pressing ENTER rsearing ASP.NET 2.0 Basics 6 July 22nd, 2007 08:21 PM
Login Control Mahill ASP.NET 2.0 Basics 1 May 19th, 2006 02:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.