views:

138

answers:

3

When a user logs in to my site I want a css styled button to appear (this could be anything really, i.e. some special news text item etc), how can you do this via masterpages in asp.net? Or is there some other way you do this?

+1  A: 

This MSDN article describes how you can find and manipulate master page content from a content page.

MSDN

Steve Horn
+2  A: 

Check out the LoginView control in ASP.Net. It takes two templates - one for logged in users and one for not-logged in users. I guess it should do what you want.

Rune Grimstad
+2  A: 

You haven't provided a whole lot of information about your setup simon, but assuming you're using a .NET Membership Provider, then you can use a login view to have a section of your page render differently for logged in Vs. not

    <asp:LoginView>
        <AnonymousTemplate>
            Nothing Displayed
        </AnonymousTemplate>
        <LoggedInTemplate>
            <asp:Button ID="myButton" runat="server">
        </LoggedInTemplate>
    </asp:LoginView>
Eoin Campbell