.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
abhays
satyapriyanayak
SP
Ashutosh Jha
ASPEvil
Post New Web Links

Profile Provider in Asp.Net MVC

Posted By: krokonoster     Posted Date: August 21, 2010    Points: 0   Category :ASP.Net
 
The article Profile Provider in Asp.Net MVC was added by krokonoster on Wednesday, June 02, 2010.

Finding very little information on how to implement Profiles in Asp.Net MVC, I thought I'd share my solution to implement this. For demonstration purposes, let's assume you want to store a user's First and Last Name only. Firstly I created


View Complete Post


More Related Resource Links

Programmatically Changing the Profile Provider at Runtime

  

Dear All

I'm using one application but have multiple providers in my web.config for memberships, roles and profiles to allow my application to be used by different groups of users who need to connect to different databases.

This means I'm having to change the membership, role and profile providers on-the-fly in my code-behind files. So far I've taken care of the membership and roles a bit like this:

Dim RolePV As RoleProvider = Roles.Providers(GetSettingFromFile("Provider"))

However, I'm having trouble finding out how to do the same sort of thing for Profiles. I've looked at ProfileProvider and ProfileManager but I can't work it out how to access my the profile property that I've created in my web.config file called "ScreenSize". Normally you would just write Profile.ScreenSize to read or write to the property.

Please can you help me to understand how I access the profile property called ScreenSize by dynamically setting the profile provider first?

I'd be very grateful for any help or advice.

Many thanks

Daniel

 


FBA users (ldap provider) don't have any user profile info when logged in.... what am I doing wrong

  
Sharepoint 2010, Claims authentication, FBA using ldap membership provider and role provider against Active Directory.  User profiles all imported just fine -- used the LDAP FBA provider hitting Active Directory to do so too.  whenever an FBA user logs in, it doesn't seem like sharepoint is picking up any user attributes.  targeted audiences don't work and MY SETTINGS is blank other than account and name.  If the same user logs in but through Active Directory, everything works just fine... targeted audiences, etc. Am I doing something wrong or can I not use the LDAP provider to authenticate to AD and also use the user profiles from Sharepoint?  GRRRRR.  All this to get around the Windows Authentication popup so I can customize a better looking logon experience.  Help?

Using the SQL Table Profile Provider in ASP.NET 4 Web Applications (C# & VB)

  
 Just an FYI for those trying to use the SqlTableProfileProvider in a Web application project. Here's my article: Using the SQL Table Profile Provider in ASP.NET 4 Web Applications (C# & VB) http://weblogs.asp.net/kencox/archive/2010/09/05/using-the-sql-table-profile-provider-in-asp-net-4-web-applications-c-amp-vb.aspx The complete projects are here: http://code.msdn.microsoft.com/aspnet4profile   Ken        

Using the SQL Table Profile Provider in ASP.NET 4 Web Applications (C# & VB)

  
This post and accompanying projects demonstrate how to use Microsoft's SQL Table Profile Provider with an ASP.NET Web application. ASP.NET's built-in Profile provider (SqlProfileProvider) stores Profile data in an oddball, serialized format that's hard to use in queries and may not scale well in large sites. To help developers use a more standard database format, Microsoft posted the source code for a sample provider (SqlTableProfileProvider). It stores each Profile property in a separate database...(read more)

Profile Provider

  

Hi All,

I'm trying to implement on a MVC2 web application tha authentication. I successfully use standard Roles and Login through default Membership Provider, I can store usernames, passwords ,roles, assign roles to users etc. I'm not able to expand the user data. I need to save personal information such as address, phone numbers etc.

I try to implement a custom ProfileProvider following some tutorial online:

	public class UserProfile : ProfileBase
	{
		#region Properties

		[SettingsAllowAnonymous(false)]
		public string FirstName
		{
			get { return base["FirstName"] as string; }
			set { base["FirstName"] = value; }
		}

		[SettingsAllowAnonymous(false)]
		public string SecondName
		{
			get { return base["SecondName"] as string; }
			set { base["SecondName"] = value; }
		}

		[SettingsAllowAnonymous(false)]
		public string LastName
		{
			get { return base["LastName"] as string; }
			set { base["LastName"] = value; }
		} 

		#endregion

		public static UserProfile GetUserProfile(string username)
		{
			return Create(username) as UserProfile;
		}
	}


but I can't find a method to show the whole list of user. I saw that the ProfileProv

Setting Membership/Profile/Role provider's connection string at runtime...?

  

How can I set the connection string for the built-in membership, profile and role providers at runtime?

Since each site in our multi-site application uses a separate API to retrieve its specific connection string (via key, for security purposes), I cannot set the connection string to my providers in the web.config file. I need to be able to set the connection strings programmatically at runtime, but I cannot find how to implement this.

I thought many people must have run into this problem, but I can't seem to find anything regarding this.Can anyone here help me with this problem?

 

Sebastian


Custom Profile Provider and Role - Mysql

  

May I ask if how can I create a custom mysql profile provider with the following properties?

<properties>
                <add name="ProjectID" type="Int" defaultValue="0"/>
                <add name="TeamID" type="Int" defaultValue="0"/>
                <add name="EmployeeID" type="String" serializeAs="String"/>
                <add name="LastName" type="String" serializeAs="String"/>
                <add name="FirstName" type="String" serializeAs="String"/>
                <add name="MiddleName" type="String" serializeAs="String"/>
                <add name="NickName" type="String" serializeAs="String"/>
           &n

SQL Table Profile Provider

  

Hi,

I use Miscrosoft SQL Table Profile Provider (http://code.msdn.microsoft.com/aspnet4profile/Release/ProjectReleases.aspx?ReleaseId=4922)

as custom profile provider because I need access user's properties from SQL queries. But

I notice that UserId in my customer profile table is different from UserId of aspnet_User table, so I can't join these tables.

How do I connect the properties to users?


Code Optimized Web Development Profile (VS 2010 and .NET 4.0 Series)

  
When you first run VS 2010 it prompts you to select an IDE profile to use. The profile you select will configure how tool windows are displayed/docked in the IDE by default and set the default keyboard shortcuts. You can then customize any of these settings by using the Tools->Options menu within the IDE and then override/change them. You can also later reset your profile and pick a different one by choosing the Tools->Import and Export Settings menu command.

Building a LINQ Provider

  
Throughout this article, we will build a simple IQueryable provider similar to the LINQ to SQL provider demonstrating what is needed to build a custom provider that is capable of executing LINQ queries and performing create, update and delete operations.

Configuring Profile Image Export in SharePoint 2010

  
It's no secret that I am thrilled with the new social features of SharePoint 2010. I am most excited about the new Profile Picture handling. I strongly believe that the more we can show the faces of our colleagues to one another the more connected we will feel. Clearly Microsoft feels that way as witnessed by the many features that make use of the Profile Image like the Activity Feed and Colleagues list

Membership Provider Conn String

  

Hello. I've bee successfully using the Asp.Net Membership Provider in my VB.Net 3.5/SQL 2005 web app for a year now (Site A). However, I've added 2 new sites (B and C) (both with their own DB) and now I see a problem. It looks like users that get created for sites B and C also get created in site A. Roles that I create for B and C only get created in A. I think it is a conn string problem.

When I created A, I adde the conn string to my machine.config (not sure why I did this or if it is even needed)...

MACHINE.CONFIG

<connectionStrings>
         <add name="LocalSqlServer" connectionString="Data Source=VS689\SQLEXPRESS;Initial Catalog=SiteA;USER ID=sa;PASSWORD=123456"/>
</connectionStrings>

In my WEB.CONFIG

<membership>
            <providers>
                <clear/>
                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=blahblah" connectionStringName="LocalSqlS

Profile not being save after redirect.

  

Hello,

I am trying to save values into a Profile on Page1, then redirect to Page2 and access those values.  However, after the page redirects the profile values are blank as if they were never saved.   When stepping through the code I can see that they are being save on Page 1.

I suppose I could use session variables to store the information but I don't understand why saving the profile doesn't work.

//Page1
private void PayWithPayPal()
    {
        ProfileCommon profile = this.Profile;

        if (Global.CurrentUserName.Length > 0)
            profile = this.Profile.GetProfile(Global.CurrentUserName);
        
        profile.FirstName = uxFirstNameShipping.Text;
        profile.LastName = uxLastNameBilling.Text;
        profile.ShippingAddress.AddressLineOne = uxAddressLineOneShipping.Text;
        profile.ShippingAddress.AddressLineTwo = uxAddressLineTwoShipping.Text;
        profile.ShippingAddress.City = uxCityShipping.Text;
        profile.ShippingAddress.State = uxStateShipping.Text;
        profile.ShippingAddress.ZipCode = uxPostalCodeShipping.Text;

        profile.Save();
        
        Response.Redirect("~/expresspayment.aspx", false);
    }

//Page2
protected void Page_Load(object sender, EventArgs e)
    {
        
        ProfileCommon p

Which is the best sql provider?

  

Which is the best sql provider on .NET Framework : DataSet, LINQ, ADO.NET Entity Framework?



Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend