Accessing a control within LoginView

Discussion in 'ASP .Net' started by Davie, Sep 4, 2005.

  1. Davie

    Davie Guest

    I'm trying out the new membership services in ASP.NET 2.0.

    This is a basic question, but how can i access a control within a LoginView
    ?

    I want to set the value of a label which is inside the LoggedInTemplate.
    this.LoginView.LoggedInTemplate

    Many thanks.
    Davie, Sep 4, 2005
    #1
    1. Advertising

  2. Hi Davie,

    Welcome to ASPNET newsgroup.
    Regarding on the accessing a nested control in LoginView control's template
    question, based on my research, we can do this through the following means:

    For the LoginView control, when being added onto a page, at a certain time,
    only one Template (anonymous or loggedIn ) is applied on the Control
    instance, so at that time, we can only retrieve the reference of those
    controls in the active template( can't access those in the non-active
    template). So you can first determine whether the user has been
    authenticated or not and then use the LoginView.FindControl( stringId)
    together with the sub control's ID to retrieve the control reference.

    Thanks & Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)





    --------------------
    | From: "Davie" <>
    | Subject: Accessing a control within LoginView
    | Date: Sun, 4 Sep 2005 12:20:51 +0100
    | Lines: 11
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | X-RFC2646: Format=Flowed; Original
    | Message-ID: <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: 82-41-9-147.cable.ubr02.edin.blueyonder.co.uk
    82.41.9.147
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet:122262
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | I'm trying out the new membership services in ASP.NET 2.0.
    |
    | This is a basic question, but how can i access a control within a
    LoginView
    | ?
    |
    | I want to set the value of a label which is inside the LoggedInTemplate.
    | this.LoginView.LoggedInTemplate
    |
    | Many thanks.
    |
    |
    |
    Steven Cheng[MSFT], Sep 5, 2005
    #2
    1. Advertising

  3. Hi Davie,

    Does the suggestions in my last reply help you? If there're anything else
    we can help, please feel free to post here. Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    --------------------
    | X-Tomcat-ID: 81368670
    | References: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain
    | Content-Transfer-Encoding: 7bit
    | From: (Steven Cheng[MSFT])
    | Organization: Microsoft
    | Date: Mon, 05 Sep 2005 06:22:15 GMT
    | Subject: RE: Accessing a control within LoginView
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | Message-ID: <S5j#>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | Lines: 50
    | Path: TK2MSFTNGXA01.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet:122387
    | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
    |
    | Hi Davie,
    |
    | Welcome to ASPNET newsgroup.
    | Regarding on the accessing a nested control in LoginView control's
    template
    | question, based on my research, we can do this through the following
    means:
    |
    | For the LoginView control, when being added onto a page, at a certain
    time,
    | only one Template (anonymous or loggedIn ) is applied on the Control
    | instance, so at that time, we can only retrieve the reference of those
    | controls in the active template( can't access those in the non-active
    | template). So you can first determine whether the user has been
    | authenticated or not and then use the LoginView.FindControl( stringId)
    | together with the sub control's ID to retrieve the control reference.
    |
    | Thanks & Regards,
    |
    | Steven Cheng
    | Microsoft Online Support
    |
    | Get Secure! www.microsoft.com/security
    | (This posting is provided "AS IS", with no warranties, and confers no
    | rights.)
    |
    |
    |
    |
    |
    | --------------------
    | | From: "Davie" <>
    | | Subject: Accessing a control within LoginView
    | | Date: Sun, 4 Sep 2005 12:20:51 +0100
    | | Lines: 11
    | | X-Priority: 3
    | | X-MSMail-Priority: Normal
    | | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | | X-RFC2646: Format=Flowed; Original
    | | Message-ID: <>
    | | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | | NNTP-Posting-Host: 82-41-9-147.cable.ubr02.edin.blueyonder.co.uk
    | 82.41.9.147
    | | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
    | | Xref: TK2MSFTNGXA01.phx.gbl
    | microsoft.public.dotnet.framework.aspnet:122262
    | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | |
    | | I'm trying out the new membership services in ASP.NET 2.0.
    | |
    | | This is a basic question, but how can i access a control within a
    | LoginView
    | | ?
    | |
    | | I want to set the value of a label which is inside the LoggedInTemplate.
    | | this.LoginView.LoggedInTemplate
    | |
    | | Many thanks.
    | |
    | |
    | |
    |
    |
    Steven Cheng[MSFT], Sep 8, 2005
    #3
  4. Davie

    Davie Guest

    Sorry Steven,

    I thought I'd posted to this. Your posting helped me out great.

    Thanks very much!

    Davie.

    "Steven Cheng[MSFT]" <> wrote in message
    news:$...
    > Hi Davie,
    >
    > Does the suggestions in my last reply help you? If there're anything else
    > we can help, please feel free to post here. Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    > --------------------
    > | X-Tomcat-ID: 81368670
    > | References: <>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain
    > | Content-Transfer-Encoding: 7bit
    > | From: (Steven Cheng[MSFT])
    > | Organization: Microsoft
    > | Date: Mon, 05 Sep 2005 06:22:15 GMT
    > | Subject: RE: Accessing a control within LoginView
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > | Message-ID: <S5j#>
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    > | Lines: 50
    > | Path: TK2MSFTNGXA01.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet:122387
    > | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
    > |
    > | Hi Davie,
    > |
    > | Welcome to ASPNET newsgroup.
    > | Regarding on the accessing a nested control in LoginView control's
    > template
    > | question, based on my research, we can do this through the following
    > means:
    > |
    > | For the LoginView control, when being added onto a page, at a certain
    > time,
    > | only one Template (anonymous or loggedIn ) is applied on the Control
    > | instance, so at that time, we can only retrieve the reference of those
    > | controls in the active template( can't access those in the non-active
    > | template). So you can first determine whether the user has been
    > | authenticated or not and then use the LoginView.FindControl( stringId)
    > | together with the sub control's ID to retrieve the control reference.
    > |
    > | Thanks & Regards,
    > |
    > | Steven Cheng
    > | Microsoft Online Support
    > |
    > | Get Secure! www.microsoft.com/security
    > | (This posting is provided "AS IS", with no warranties, and confers no
    > | rights.)
    > |
    > |
    > |
    > |
    > |
    > | --------------------
    > | | From: "Davie" <>
    > | | Subject: Accessing a control within LoginView
    > | | Date: Sun, 4 Sep 2005 12:20:51 +0100
    > | | Lines: 11
    > | | X-Priority: 3
    > | | X-MSMail-Priority: Normal
    > | | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    > | | X-RFC2646: Format=Flowed; Original
    > | | Message-ID: <>
    > | | Newsgroups: microsoft.public.dotnet.framework.aspnet
    > | | NNTP-Posting-Host: 82-41-9-147.cable.ubr02.edin.blueyonder.co.uk
    > | 82.41.9.147
    > | | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
    > | | Xref: TK2MSFTNGXA01.phx.gbl
    > | microsoft.public.dotnet.framework.aspnet:122262
    > | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > | |
    > | | I'm trying out the new membership services in ASP.NET 2.0.
    > | |
    > | | This is a basic question, but how can i access a control within a
    > | LoginView
    > | | ?
    > | |
    > | | I want to set the value of a label which is inside the
    > LoggedInTemplate.
    > | | this.LoginView.LoggedInTemplate
    > | |
    > | | Many thanks.
    > | |
    > | |
    > | |
    > |
    > |
    >
    Davie, Sep 9, 2005
    #4
  5. My pleasure :)

    Enjoying Whidbey!

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    --------------------
    | From: "Davie" <>
    | References: <>
    <S5j#>
    <$>
    | Subject: Re: Accessing a control within LoginView
    | Date: Fri, 9 Sep 2005 11:34:54 +0100
    | Lines: 109
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | X-RFC2646: Format=Flowed; Original
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | Message-ID: <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: 82-41-9-147.cable.ubr02.edin.blueyonder.co.uk
    82.41.9.147
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet:123385
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | Sorry Steven,
    |
    | I thought I'd posted to this. Your posting helped me out great.
    |
    | Thanks very much!
    |
    | Davie.
    |
    | "Steven Cheng[MSFT]" <> wrote in message
    | news:$...
    | > Hi Davie,
    | >
    | > Does the suggestions in my last reply help you? If there're anything
    else
    | > we can help, please feel free to post here. Thanks,
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! www.microsoft.com/security
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | >
    | > --------------------
    | > | X-Tomcat-ID: 81368670
    | > | References: <>
    | > | MIME-Version: 1.0
    | > | Content-Type: text/plain
    | > | Content-Transfer-Encoding: 7bit
    | > | From: (Steven Cheng[MSFT])
    | > | Organization: Microsoft
    | > | Date: Mon, 05 Sep 2005 06:22:15 GMT
    | > | Subject: RE: Accessing a control within LoginView
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | > | Message-ID: <S5j#>
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | > | Lines: 50
    | > | Path: TK2MSFTNGXA01.phx.gbl
    | > | Xref: TK2MSFTNGXA01.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet:122387
    | > | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
    | > |
    | > | Hi Davie,
    | > |
    | > | Welcome to ASPNET newsgroup.
    | > | Regarding on the accessing a nested control in LoginView control's
    | > template
    | > | question, based on my research, we can do this through the following
    | > means:
    | > |
    | > | For the LoginView control, when being added onto a page, at a certain
    | > time,
    | > | only one Template (anonymous or loggedIn ) is applied on the Control
    | > | instance, so at that time, we can only retrieve the reference of those
    | > | controls in the active template( can't access those in the non-active
    | > | template). So you can first determine whether the user has been
    | > | authenticated or not and then use the LoginView.FindControl( stringId)
    | > | together with the sub control's ID to retrieve the control reference.
    | > |
    | > | Thanks & Regards,
    | > |
    | > | Steven Cheng
    | > | Microsoft Online Support
    | > |
    | > | Get Secure! www.microsoft.com/security
    | > | (This posting is provided "AS IS", with no warranties, and confers no
    | > | rights.)
    | > |
    | > |
    | > |
    | > |
    | > |
    | > | --------------------
    | > | | From: "Davie" <>
    | > | | Subject: Accessing a control within LoginView
    | > | | Date: Sun, 4 Sep 2005 12:20:51 +0100
    | > | | Lines: 11
    | > | | X-Priority: 3
    | > | | X-MSMail-Priority: Normal
    | > | | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | > | | X-RFC2646: Format=Flowed; Original
    | > | | Message-ID: <>
    | > | | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | > | | NNTP-Posting-Host: 82-41-9-147.cable.ubr02.edin.blueyonder.co.uk
    | > | 82.41.9.147
    | > | | Path:
    TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
    | > | | Xref: TK2MSFTNGXA01.phx.gbl
    | > | microsoft.public.dotnet.framework.aspnet:122262
    | > | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | > | |
    | > | | I'm trying out the new membership services in ASP.NET 2.0.
    | > | |
    | > | | This is a basic question, but how can i access a control within a
    | > | LoginView
    | > | | ?
    | > | |
    | > | | I want to set the value of a label which is inside the
    | > LoggedInTemplate.
    | > | | this.LoginView.LoggedInTemplate
    | > | |
    | > | | Many thanks.
    | > | |
    | > | |
    | > | |
    | > |
    | > |
    | >
    |
    |
    |
    Steven Cheng[MSFT], Sep 9, 2005
    #5
  6. Davie

    Petulka77

    Joined:
    Sep 26, 2007
    Messages:
    2
    Thank you

    Thanks. It helped a lot. It just logical.
    Petulka77, Sep 30, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CJ Taylor

    LoginView Type Control

    CJ Taylor, Nov 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    366
    Curt_C [MVP]
    Nov 15, 2004
  2. Christopher W.

    accessing labels in a loginview....

    Christopher W., Jul 14, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    329
    Christopher W.
    Jul 14, 2006
  3. sunfire
    Replies:
    0
    Views:
    322
    sunfire
    Jun 14, 2007
  4. sunfire
    Replies:
    0
    Views:
    331
    sunfire
    Jun 14, 2007
  5. Steve Harp

    Accessing Controls in LoginView

    Steve Harp, Feb 22, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    181
    Teemu Keiski
    Feb 25, 2007
Loading...

Share This Page