Displaying buttons for users only

Last post 12-28-2009 3:03 AM by Shetty Abhijit J.. 4 replies.

Sort Posts:

  • Displaying buttons for users only

    1 hour, 19 minutes ago
    • Member
      4 point Member
    • STEVE.com
    • Member since 11-27-2009, 4:24 AM
    • Posts 33

    I am creating a website that will have common navigation buttons on the top of the page (i.e. Home, About Us, Contact Us, etc).  I will then allow people to log in.  I would like for logged in users to have an extra button that displayes once they are logged in (i.e. Home, About Us, Contact Us, Upload Photo).  How can I do this.

    Thanks,
    Steve

  • Re: Displaying buttons for users only

    46 minutes ago
    • Participant
      783 point Participant
    • johnyM456
    • Member since 09-28-2009, 1:28 PM
    • Belgium
    • Posts 141

    I suppose you want to use links instead of buttons, but it's the same technique for both:

    <a href="" runat="server" visible='<%= httpcontext.current.user.isauthenticated%>'>Upload Pics</a> 

  • Re: Displaying buttons for users only

    44 minutes ago
    • Member
      610 point Member
    • Ahmed Moosa
    • Member since 10-01-2009, 10:58 PM
    • Egypt
    • Posts 111

    Hi

    you Can use Login view to display Different Content

    http://quickstarts.asp.net/QuickStartv20/aspnet/doc/security/login.aspx#loginview


    if you work with Sitemap you can use Authortization in web.Config

    Put your User Pages in UserFolder ::

    <Location Path="UsersFolder" >

    <system.web>

       <authorization>

        <allow user="*" >

       <deny  user="?" >

        <authorization>

    <system.web>

    </Location>

    use this Link

    http://quickstarts.asp.net/QuickStartv20/aspnet/doc/security/authorization.aspx


    Hope this Help


    :


    My Blog

    الحمد لله رب العالمين
  • Re: Displaying buttons for users only

    39 minutes ago
    • Participant
      967 point Participant
    • rezakawser
    • Member since 03-26-2009, 6:27 AM
    • Dhaka,Bangladesh
    • Posts 159

    You can use Login View for this purpose

    Write no access element under 

    AnonymousTemplate

    write after logged in content under 

    LoggedInTemplate

    just simply

     <asp:loginview ID="Loginview1" runat="server">
            <LoggedInTemplate>
                Home, About Us, Contact Us, Upload Photo
            </LoggedInTemplate>
            <AnonymousTemplate>
                Home, About Us, Contact Us<br />
            </AnonymousTemplate>
            </asp:loginview>



    Parves Kawser


    Please remember to click,

    "Mark As Answer"

    on the post that helps you.
  • Re: Displaying buttons for users only

    21 minutes ago

    Hi,


    You can have a link on top of page

    and you can make that control visible true/false despending on user Role that you can get if you place that in Session..

    and depending on that in PageLoad under !IsPostBack you can make that control visible False


    Thanks...AJ...Regards,
    Shetty Abhijit Jayaram.

    Mark the Post as ANSWER ,if the post helped you...

    Problems are opportunities and Never accept defeat in life...
Page 1 of 1 (5 items)