Accessing a control within LoginView

D

Davie

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.
 
S

Steven Cheng[MSFT]

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" <[email protected]>
| 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: <[email protected]>
| 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.
|
|
|
 
S

Steven Cheng[MSFT]

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: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (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#[email protected]>
| 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" <[email protected]>
| | 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: <[email protected]>
| | 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.
| |
| |
| |
|
|
 
D

Davie

Sorry Steven,

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

Thanks very much!

Davie.

Steven Cheng said:
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: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (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#[email protected]>
| 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" <[email protected]>
| | 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: <[email protected]>
| | 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.
| |
| |
| |
|
|
 
S

Steven Cheng[MSFT]

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" <[email protected]>
| References: <[email protected]>
<S5j#[email protected]>
<[email protected]>
| 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: <[email protected]>
| 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.
|
| | > 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: <[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain
| > | Content-Transfer-Encoding: 7bit
| > | From: (e-mail address removed) (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#[email protected]>
| > | 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" <[email protected]>
| > | | 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: <[email protected]>
| > | | 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.
| > | |
| > | |
| > | |
| > |
| > |
| >
|
|
|
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top