Security :: Update Profile Not Updating?
Feb 18, 2010There is no error produced, but it does not seem to update the profile, any thoughts?
[Code]....
There is no error produced, but it does not seem to update the profile, any thoughts?
[Code]....
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]....
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]....
There is a CreateUserWizard. Is there an UpdateUserWizard somewhere for updating user profile? Please advise or direct to sample link.
View 1 RepliesI 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 RepliesIn asp.net (using MVC, but this happens in regular too)
Profile.GetProfile(username);
will update the LastActivityDate for that user. This is not intended when someone else is viewing that user's profile.
In the membership class you can specify whether to update this date with a second param, like so:
Membership.GetUser(username, false); // doesn't update LastActivityDate
Membership.GetUser(username, true); // updates LastActivityDate
Is there anyway to do something similar in the Profile provider without writing my own provider?
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(....)
Above is my code to call a hidden DIV:
[Code]....
And above the html for the DIV:
[Code]....
on Code behind:
[Code]....
Now i was trying to use an UPDATE PANEL, in order to when i click button Save, only the DIV updates. Because the whole DIV is closing when i click on SAVE, even if i put a div in an update panel.
I am having a weird issue with the update panels. I have an update panel in UpdateMode = Conditional . I have a dropdown list and a grid view..the gridview has to be updated ÖnSelectionChanged event on the dropdown.
The issue here is on changing the selection on dropdown, the onselectionchanged event is triggered, new data is grabbed, bound to gridview..but does nt update the update panel even after the updatepanel.update();
[Code]....
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?
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 ...
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 RepliesI 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 Repliesi'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 !?
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.
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 RepliesI 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.
I have a panel withitn an updatepanel with some buttons.
When one of the buttons is pressed, I'm updating a different update panel.
The problem is that when I click the button, nothing seems to happen.
If I click the button again , then I see the first update. If I click it again, I see the second update and so on..
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 RepliesI 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?
i want to use profile provider in webformapplication
i hear that profile provider can only be used by website
is there some way to use it also in webform application?
i try to useProfileCommon method but i got an error
While using profile in ASP.net 3.5 Error comes The name 'Profile' does not exist in the current context My code behind
Profile.FirstName = "ABC";
My web config
connectionStrings
>
<
add
name="MyConnection"
connectionString="server=AJAYG;uid=sa;pwd=cybage@123;database=TestDatabse"
/>
<
remove
name="LocalSqlServer"
/>
<
add
name="LocalSqlServer"
connectionString="server=AJAYG;uid=sa;pwd=cybage@123;database=TestDatabse"
providerName="System.Data.SqlClient"
/>
</
connectionStrings
>
<
system.web
>
<
anonymousIdentification
enabled ="true"
/>
<
profile
enabled="true
"
automaticSaveEnabled="false"
>
<
providers
>
<
clear
/>
<
add
name="AspNetSqlProfileProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="LocalSqlServer"
/>
</
providers>
<
properties
>
<
add
name="FirstName"
defaultValue="ABC"
allowAnonymous ="true"
/>
<
add
name="LastName"
defaultValue="ABC"
allowAnonymous ="true"
/>
<
add
name="LastVisit"
defaultValue="ABC"
type ="System.DateTime"
allowAnonymous ="true"
/>
</
properties
>
</
profile
>
In my application I am using the aspnetdb membership for authorizing users. I created a new table UserProfiles that will hold their profile information. The UserID is linked to aspnet_users UserID with a foreign key. One of the columns in the table represent CompanyID (int). I want to be able to restrict logged in users to only see records from their company based on the CompanyID. There can be more than one user with the same CompanyID to the UserID would not work. I can restrict their access by UsedID to only see records they created by using code behind:
[Code]....
and my select statement is:
[Code]....
How would be the best way to restrict the selected data to UserProfiles.CompanyID?
I have a site I'm working on where the values being stored in user profiles can change so I need to iterate through all available profile options and display them (say in a label or gridview for instance). Here is an example of a web.config I threw together
<profile enabled="true">
I'm authenticating my users using the following code for the login event:
[Code]....
The following code runs in global.asax at Application_AuthenticateRequest:
[Code]....
Everything works great so far. Next thing that I need to do is add additional user information to the forms authentication ticket using user profile. When I try to add it right after the login code above, I end up getting an error message about anonymous profile. On the other hand, HttpContext.Profile is read only and doesn't seem to work. Is there any workaround for this?