Security :: Caching Profile Object?

Dec 16, 2010

I have an MVC Web App project. Because the Profile object is only available to website apps, I've written my own Profile class that inherits from ProfileBase (as described in various places around the web). I'm also using the AppFabric cache. I would like to cache the logged in user's Profile object so that every time I access the Profile, it comes from the cache and not the aspnet database tables. However, I've hit a problem. When I try to add the Profile to the AppFabric cache, I get this error: The use of type 'System.Configuration.SettingsContext' as a get-only collection is not supported with NetDataContractSerializer. Consider marking the type with the CollectionDataContractAttribute attribute or the SerializableAttribute attribute or adding a setter to the property. I've noticed that ProfileBase inherits from SettingsBase, which indeed contains a read-only property called "Context" of type SettingsContext. I've tried for a few hours now to get my Profile:ProfileBase to serialize, but to no avail.

View 2 Replies


Similar Messages:

Does The .NET SQL Profile Provider Use Caching?

Aug 11, 2010

Does the ASP.NET SQL Profile Provider use caching? I mean if I pull data from the profile for a user will it hit the DB for each request?

I'm looking for a setting or any information on this. I had thought I read it would use cookies but I can't find this now.

Edit: http://msdn.microsoft.com/en-us/library/aa478953.aspx describes process as

When called by SqlProfileProvider.GetPropertyValues, aspnet_Profile_GetProperties performs the following actions:

Queries the aspnet_Applications table to convert the application name input to it into an application ID.

Queries the aspnet_Users table to convert the user name input to it into a user ID.

Queries the aspnet_Profile table for the PropertyNames, PropertyValuesString, and PropertyValuesBinary fields for the specified user.

Updates the user's last activity date in the aspnet_Users table with the current date and time.

View 1 Replies

Security :: Creating A Profile For A New User Is Updating Other Profile

Feb 4, 2010

I am logged in as user1, and while creating a user in which I have additional information which would store first and last name into the profile database. I have the following code

[Code]....

But because I just have profile like that, it is updating the profile of user1 not the new user i just created

[Code]....

View 5 Replies

Security :: Added Profile Provider To Web.config Then Receive Error "Violation Of UNIQUE KEY Constraint IX_aspnet_Users - Cannot Insert Duplicate Key In Object Dbo.aspnet_Users"

Aug 9, 2010

I developed a site for a client a couple of years ago. It uses the the standard ASP.NET Membership, authentication, etc. I just added the profile section with (2) fields: CustID AgntID. Now whenever I load the page with any Profile code in it I receive this error: Violation of UNIQUE KEY constraint 'IX_aspnet_Users'. Cannot insert duplicate key in object 'dbo.aspnet_Users'. The INSERT statement conflicted with the FOREIGN KEY constraint "FK__aspnet_Pr__UserI__3CA9F2BB". The conflict occurred in database "broo001", table "dbo.aspnet_Users", column 'UserId'. The statement has been terminated. The statement has been terminated. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint 'IX_aspnet_Users'. Cannot insert duplicate key in object 'dbo.aspnet_Users'. The INSERT statement conflicted with the FOREIGN KEY constraint "FK__aspnet_Pr__UserI__3CA9F2BB". The conflict occurred in database "broo001", table "dbo.aspnet_Users", column 'UserId'. The statement has been terminated. The statement has been terminated. Source Error:

[Code]....

Stack Trace:

[Code]....

Here is the code from my web.config:

[Code]....

Here is some of my page code:

[Code]....

View 3 Replies

Security :: Want To Use Profile And Have A Profile Property?

Dec 5, 2010

I'm being stupid but don't know what I'm missing.I want to use asp.net profile and have a profile property.So in the webconfig for my site I've added:

<profile>
<properties>
<add name="Name"/>
</properties>
</profile>

But in the code behind a page I cannot use Profile.Visual Studio is just saying the Profile is not known in the current context.Thus I cannot do

Profile.Name = ....
or
x = Profile.GetPropertyValue(....)

View 13 Replies

Web Forms :: Can't Access Profile Object In Code Behind?

May 11, 2010

I'm having trouble accessing custom profile properties that I've declared in my web.config using the TableProfileProvider available at [URL] I set everything up according to the instructions but keep receiving an error stating "The type or namespace name 'Profile' could not be found" whenever I refer to the Profile object in my codebehind. My web.config is:

<profile enabled="true" defaultProvider="TableProfileProvider">
<providers>
<clear />
<!-- below is the asp.net default provider -->
<!--<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="WebPortalDb" applicationName="/" />-->
<add name="TableProfileProvider"
type="Microsoft.Samples.SqlTableProfileProvider"
connectionStringName="WebPortalDb"
table="_ExtendedUserProfileData"
applicationName="WebPortal" />
</providers>
<properties>
<add name="FirstName"
type="string"
defaultValue="[null]"
customProviderData="FirstName;nvarchar" />
<add name="LastName"
type="string"
defaultValue="[null]"
customProviderData="LastName;nvarchar" />
<add name="EmailAddress"
type="string"
defaultValue="[null]"
customProviderData="EmailAddress;nvarchar" />
<add name="LastUpdateDate"
type="datetime"
defaultValue="[null]"
customProviderData="LastUpdatedDate;datetime" />
</properties>
</profile>

View 4 Replies

Web Forms :: SqlTableProfileProvider Can't Access Profile Object

Jun 4, 2010

I'm having trouble getting started with the SqlTableProfileProvider. The documentation is here:[URL]I have set up my project exactly like the whitepaper example but I can't access the Profile.SomeProfileField. When I build the project it shows that the Profile object doesn't exist in the current context. I have included the System.Web.Security and System.Web.Profile namespaces. I tried to add a reference to System.Web.Profile but can't find that DLL anywhere to add. Can anyone push me in the right direction?

View 3 Replies

Caching In .net - Error Like "An Object Reference Is Required For Non Static Field?

Feb 9, 2011

I m having a webService.

In that I m using Caching.

I have wrote following code to store datatable in cache.

using System.Web.Caching;

Cache.Insert("dt", dt, null, DateTime.Now.AddHours(1), TimeSpan.Zero, System.Web.Caching.CacheItemPriority.Default, null);


It give me error like "An object Reference is required for non static field.

View 2 Replies

State Management :: Profile Object / Properties Not Accessible In Code Behind

Oct 29, 2010

i have defined profile properties in my web config file but unable to access them in code behind. even profile object is not available. i have to writer fully qualified name like System.Web.Profile. below is my web config

<profile>

View 2 Replies

Web Forms :: Profile Object - Compiler Doesn't Recognize Surname?

May 28, 2010

I have created profile objects in my web.config file:

[Code]....

[Code]....

In all tutorials I am finding on the net it says in order to read/write from these properties I just need to use the syntax with C#:

Profile.Surname = "Surname";

But this does not work on my web site code when I'm using C# it underlines and recommends I change to System.Web.Profile.Surname (which I do) but then Intellisense and the compiler do not recognise Surname. What am I doing wrong? I am using Visual Studio 2010 and .Net V4.

View 5 Replies

Security :: Use The Profile Other Than Default?

Mar 3, 2010

I'm making another attempt to find out how to use a different profile in the web application. I though it would be quite simple. but couldn't find an answer anywhere.

All I need to know is how to call "i90ProfileProvider" instead of default "i90PartnerProfileProvider" in C# or VB.

<profile defaultProvider="i90PartnerProfileProvider">
<providers>
<clear/>
<add name="i90PartnerProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="i90Partner"/>
<add name="i90ProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="i90"/>
</providers>

There must be the way to do this. For user it works just fine:

MembershipUser user=

Membership.Providers["providername"].GetUser("username",false);

If there is a way to add a name for Profile Provider in web.config, then there must be a way to use it.

Or I should do something entirely different to retrieve the user profile form another database?

View 5 Replies

Security :: Profile And CreatUserWizard?

Mar 7, 2010

1. i use the profile feature and i noticed that the profile cant work with anonymus users . and i can understand why now it leads me to a nother problem , in the creatUserWizard i added another step wich take the personal details of the user like firstName LastName and ect... and i wanted to store the details in the profile feature...

but it wont pass me to the second step it just give me an erorr that the service can work with anonymus or something like that .

2. i stored a datetime detail in the profile and when i tried to get it it gave me the date + the hour i put the date like : 29/12/1989 18:18:00 and i want to see just the date ...

View 4 Replies

Security - Prevent Web Caching Throwing Exception?

Jan 18, 2011

I am trying to stop the caching of web pages using the following snippets in the ASP.NET however its not working and showing following error to me,

Response.CacheControl = "no-store";
Response.AddHeader("Pragma", "no-cache");
Response.Expires = -1;

[code]...

View 2 Replies

Security :: Get Users By Profile Information?

Oct 19, 2010

I am useing asp.net membership to store my users and under each users profile there is a field for their supervisor. I would like to get a list of all the users with the supervisor "Jon Doe". Is there an easy way to do this or would I just have to loop through each user and see if there supervisor = "Jon Doe" then if it is store there username in a list?

View 1 Replies

Security :: Update Profile Not Updating?

Feb 18, 2010

There is no error produced, but it does not seem to update the profile, any thoughts?

[Code]....

View 2 Replies

Security :: Cannot Update Profile Informations

May 18, 2010

I want to create the system of user profiles, where every member have profile information (address, phone number ...). Only administrator can update this information, member can only ask administrator for that update. What class i can use (ProfileManager provides only ProfileInfo and with ProfileInfo class I cannot update profile informations)

View 8 Replies

Security :: Profile Updating But Not Displaying?

Sep 28, 2010

I have a web app where I'm asking the new registered user to enter in their first name, last name and then a choice (radio buttons) of whether or not they are a solo artist, or a group! These 3 answers are held in the aspnet_Profile table. As part of the createuserwizard, it works. Saves like a charm. The user then has the ability to go in and edit these 3 fields at will. Upon page load, the two text fields (first name and last name) are blank, and the choice always defaults to the default. So it's not pulling my data for some odd reason. But, when I put put text in the field and press 'Update', it does actually update. So my issue seems specific to not getting the data on page load. I've built a custom UserProfile control by following 'The Beer House' starter kit and book. Here's my page load code for this custom control:

[Code]....

Another obsticle I have today is that none of my breakpoints are working, so I'm battling that as well. This seems very straight foward, and LOOKS correct, but no.. the txtFirstName and txtLastName aren't populated, but there is a first name and last name in the table. Even odder, in my header I have a "Hi John Doe" which concatinates the first name and last name, and this DOES display correctly in a lable. Here's that simple code:

[Code]....

View 2 Replies

Security :: Working With Profile Feature ?

Mar 1, 2010

i'm working in visual studio 2005 asp.net c#.i'm trying to learn about profile feature ... and it seems easy to use it but i have some questions ...i red some articles and tutorials about the profile feature but i dont understand where all the details that you store are stored ?in database ? xml file ?

i didnt try it yet but it seems logical to me that when you define properties in the web.config its creating tables in the database with the names you named the properties like : <profile
>
<properties>
<add[code]....

then it will creat in the database "name" and äge" fields ? is that right ? .... if yes , where is the definition of the connection with the database ?if not, how does it work ? i know that the <connectionString> in the web config connect the database that i want to use and creat it tables. for the login and creat user .does the profile use the connection string and work with the database to !?

View 5 Replies

Security :: Profile Not Saving Against User?

Nov 1, 2010

I have a website that acts as a common user details site for a few other websites. I pass a sersname to it and it gets the profile using

[Code]....

that part works fine. Now to commit the changes I use the above code to get the profilecommon for the user and then use oProfile.Save() to finish. This saves all the user data to my profile..doesn't matter which profile I use, it always gets saved to mine.

View 4 Replies

Security :: FormsAuthenticationTicket, Role, Profile?

Apr 27, 2010

I assume that any Role information is being stored in the FormsAuthenticationTicket in the UserData (delimited by some character).Second, I assume that any information in the Profile is not stored in memory / session anywhere, but when you do call the profile.VARIABLE, you are in fact doing a call to the DB (although it's simplified by the fact that it knows who you are when calling etc).Assuming the above is correct, I'm trying to complete a custom membership provider. As part of this each user will have a single role. So using a full blown role provider seems to be overkill. I assume that I can write the single role into the UserData in the FormsAuthenticationTicket myself?I would like to also store a number of other small bits of information in the ticket (such as a GroupId, VendorId which are seperate from the user / role). If I wanted to do this, and the role is held in the userdata, how would I identify what is a role and what is someother persistant data I need on the application?I could use Session items for these, but this might cause issues with the web-farm, plus the amount of data is very small (3 or 4, int32 values and maybe one string).Finally, items such as Address, PostCode, Contact Phone number all seem sensible items to place in the profile ( I'm using the table provider). Is the advantage here purely the ease of access? This isn't commonly used data, so if there is a round trip to the db thats not an issue really in this instance

View 4 Replies

Security :: Profile Notlist In The Intellisense?

Apr 9, 2010

I could not get the profile work. I add the following profile in web.config

[Code]....

Profile does not list in the intellisense.I did lots of research on it , many said asp.net website template will work, and web application template won't.I am using Visual Studio 2010 and it has only website template.

View 4 Replies

Security :: Trying To Get The GUID After The User Has Logged In/Object Reference Not Set To An Instance Of An Object

Oct 20, 2010

What is wrong with this code? The error is Object reference not set to an instance of an object.

I have the below code in my class, then on the login page i need the GUID so i can perform a lookup in one of our custom tables. But then the error above pops up before the page even loads at the line Guid guid = (Guid)userInfo.ProviderUserKey;

[Code]....

View 4 Replies

Security :: Telerik RadControl - Object Reference Not Set To An Instance Of An Object?

Sep 19, 2010

I am working with telerik and currently designing a Login Control. But however I am getting this error :

[Code]....

The code files are :
Aspx :
[Code]....

And the C# :
[Code]....

I am getting this particular error from few days in various cases, some problems are solved in turn around ways, but I don't know how to solve this one. I am facing trouble in understanding FindControl() method.

View 2 Replies

Security :: Read And Write Image To Profile?

Feb 8, 2010

I would like to use a file upload control and write the uploaded image to the user's asp.net profile property, and then read and display that image somewhere in my application.

View 1 Replies

Security :: Accessing The Profile Class From A VB.Net / VS.Net 2008 Web App?

Mar 29, 2010

I am using VB.Net/ASP.Net 2008/3.5 to create a Web Application and I am trying to access the Profile Class.

I notice that unlike a "Website" that you cannot access the Profile class from a "Web Application" and I was wondering what is the best way of adding the Profile class to a Web application?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved