Link to home
Start Free TrialLog in
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.
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

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial