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

8/22/2022 - Mon
rdogmartin

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

ASKER
Greenbase

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
dacIT

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23