Search code examples
asp.net-mvcmembershipprofile

How do you get the membership profile of a user in an ASP.NET MVC view?


Possible Duplicate:
How to assign Profile values?

I'm using ASP.NET MVC and the Membership providers. How do I get the profile of a user in a view? any particular method to get it?

The template project out of the box access the username in this way:

<%= Html.Encode(Page.User.Identity.Name) %>

I'd like to have a similar way to access the profile data.


Solution

  • The way to access the user profile on MVC is through the Profile variable in the view, like this:

    <%= Profile %>