473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Embedding Controls in LoginView removes references

When I put asp controls inside the LoginView it removes the codebehind
references so that the page will not build. For example:
<asp:LoginView ID="LoginView" runat="server" >
<LoggedInTemplate>
<asp:LoginName id="loginName" runat="server" FormatString="You
are logged in as: {0} | " />
<asp:LoginStatus id="loginStatus" runat="server"
LogoutText="logoff" />
<br />
<asp:Label ID="pageContentIsAuth" runat="server" >
Proceed to <a href="/members/">members section</a<br />
</asp:Label>
</LoggedInTemplate>
</asp:LoginView>

The LoginName, loginStatus, pageContentIsAuth control references in code
behind pagename.aspx.designer.vb are removed, but if copy them outside of the
control such as:
<asp:LoginView ID="LoginView" runat="server" >
<LoggedInTemplate>
Removed Controls
</LoggedInTemplate>
</asp:LoginView>
<asp:LoginName id="loginName" runat="server" FormatString="You are logged in
as: {0} | " />
<asp:LoginStatus id="loginStatus" runat="server" LogoutText="logoff" />

<br />
<asp:Label ID="pageContentIsAuth" runat="server" >
Proceed to <a href="/members/">members section</a<br />
</asp:Label>

then the controls are added back to pagename.aspx.designer.vb and the page
is able to compile. I've read that you can embed controls with the LoginView
control. Is this true? If so, what do I need to do work around this issue?
Dec 23 '06 #1
3 4396
You should be able to access the controls in code-behind like
LoginView.FindControl("loginName") etc.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"jmhmaine" <jm*@online.nospamwrote in message
news:EA**********************************@microsof t.com...
When I put asp controls inside the LoginView it removes the codebehind
references so that the page will not build. For example:
<asp:LoginView ID="LoginView" runat="server" >
<LoggedInTemplate>
<asp:LoginName id="loginName" runat="server" FormatString="You
are logged in as: {0} | " />
<asp:LoginStatus id="loginStatus" runat="server"
LogoutText="logoff" />
<br />
<asp:Label ID="pageContentIsAuth" runat="server" >
Proceed to <a href="/members/">members section</a<br />
</asp:Label>
</LoggedInTemplate>
</asp:LoginView>

The LoginName, loginStatus, pageContentIsAuth control references in code
behind pagename.aspx.designer.vb are removed, but if copy them outside of
the
control such as:
<asp:LoginView ID="LoginView" runat="server" >
<LoggedInTemplate>
Removed Controls
</LoggedInTemplate>
</asp:LoginView>
<asp:LoginName id="loginName" runat="server" FormatString="You are logged
in
as: {0} | " />
<asp:LoginStatus id="loginStatus" runat="server" LogoutText="logoff" />

<br />
<asp:Label ID="pageContentIsAuth" runat="server" >
Proceed to <a href="/members/">members section</a<br />
</asp:Label>

then the controls are added back to pagename.aspx.designer.vb and the page
is able to compile. I've read that you can embed controls with the
LoginView
control. Is this true? If so, what do I need to do work around this issue?

Dec 23 '06 #2
That appears to be late bound code, do you have an example of early bound
code? I would prefer early bound code for performance reasons and I would
like to take advantage of Intellisence when referencing the object in code.
Thanks.

Josh.

"Eliyahu Goldin" wrote:
You should be able to access the controls in code-behind like
LoginView.FindControl("loginName") etc.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"jmhmaine" <jm*@online.nospamwrote in message
news:EA**********************************@microsof t.com...
When I put asp controls inside the LoginView it removes the codebehind
references so that the page will not build. For example:
<asp:LoginView ID="LoginView" runat="server" >
<LoggedInTemplate>
<asp:LoginName id="loginName" runat="server" FormatString="You
are logged in as: {0} | " />
<asp:LoginStatus id="loginStatus" runat="server"
LogoutText="logoff" />
<br />
<asp:Label ID="pageContentIsAuth" runat="server" >
Proceed to <a href="/members/">members section</a<br />
</asp:Label>
</LoggedInTemplate>
</asp:LoginView>

The LoginName, loginStatus, pageContentIsAuth control references in code
behind pagename.aspx.designer.vb are removed, but if copy them outside of
the
control such as:
<asp:LoginView ID="LoginView" runat="server" >
<LoggedInTemplate>
Removed Controls
</LoggedInTemplate>
</asp:LoginView>
<asp:LoginName id="loginName" runat="server" FormatString="You are logged
in
as: {0} | " />
<asp:LoginStatus id="loginStatus" runat="server" LogoutText="logoff" />

<br />
<asp:Label ID="pageContentIsAuth" runat="server" >
Proceed to <a href="/members/">members section</a<br />
</asp:Label>

then the controls are added back to pagename.aspx.designer.vb and the page
is able to compile. I've read that you can embed controls with the
LoginView
control. Is this true? If so, what do I need to do work around this issue?


Dec 24 '06 #3
On Sun, 24 Dec 2006 04:43:01 -0800, jmhmaine wrote:
That appears to be late bound code, do you have an example of early bound
code? I would prefer early bound code for performance reasons and I would
like to take advantage of Intellisence when referencing the object in code.
Thanks.
You can't do early bound code in login controls (or many other kinds).
Dec 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RedEye | last post by:
Hello, I have been looking for a way to add roles to a LoginView control programmatically and it's not working. I have called the sub at init and load and neither work. Does anyone know what I...
2
by: LLars | last post by:
Hey, I have the following problem: I have an asp-page which contains a loginview with two templates (loggedin- and anonymoustemplate). How can I access a textbox inside the the loggedintemplate...
1
by: mike2036 | last post by:
Hello, I wanted to display a welcome message using the logged-in user's first name in the <LoggedInTemplate> section of the LoginView. When I attempt to access my welcome label control in the...
3
by: dmm | last post by:
Hi all, I am using master pages and am having a bit of an issue. As part of my masterpage I want to display the user's current logged in status using the LoginView. However I get the following...
1
by: pj | last post by:
I'm trying to redirect users to another page after they Authenticate with the ASP.NET login controls. The user is able to login, but I can't get the response.redirect to work. Can anyone help? ...
2
by: Seb | last post by:
With in my login view I have some labels and a button with a onclick event. However when I click the button I can only access my controls by declaring a new control and using the FindControl...
4
by: Ken Fine | last post by:
I'm making an administrative interface that lists records in a GridView. For *each* row in the gridview, I would there to be two interface elements in addition to some information associated with...
32
by: =?Utf-8?B?U2l2?= | last post by:
I have a form that I programmatically generate some check boxes and labels on. Later on when I want to draw the form with different data I want to clear the previously created items and then put...
2
by: Jeff | last post by:
Hey ASP.NET 2.0 I'm about to start programming a new website at work. My boss want's me avoid using the Membership system in ASP.NET 2.0 (probably because he don't understand how it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.