Avatar of Greenbase
Greenbase

asked on 

Apply a Css Style to a LoginView Control

In ASP.Net how would I apply a style to a LoginView control? Specifically I want to point out all sections of the site that are using a LoginView with a red border.
Microsoft Development.NET ProgrammingASP.NET

Avatar of undefined
Last Comment
rdogmartin
Avatar of rdogmartin
rdogmartin
Flag of United States of America image

Apply the CSS class within the template.



<asp:LoginView ID="lv" runat="server">
 <LoggedInTemplate>
  <p class="loggedon">
    ... your HTML for logged in view ...
  </p>
 </LoggedInTemplate>
 <AnonymousTemplate>
  <p class="loggedoff">
   ... your HTML for logged off view ...
  </p>
 </AnonymousTemplate>
</asp:LoginView>

Open in new window

Avatar of Greenbase
Greenbase

ASKER

I considered this but when you have these all over the site it becomes a maintenance nightmare. I was more hoping for a solution that was a custom control that can have styles added to it.

Eg.


<tag:MyLoginView ID="lv" runat="server">
 <LoggedInTemplate>
    ... your HTML for logged in view ...
 </LoggedInTemplate>
 <AnonymousTemplate>
   ... your HTML for logged off view ...
 </AnonymousTemplate>
</tag:MyLoginView>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of dacIT
dacIT

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of rdogmartin
rdogmartin
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo