Security :: Save Custom Property Into Member Using Profile?
Jan 14, 2011
I have been struggling to save custom property data into member using createuserwizard. I add some extra fields into createuserwizard using wizardsteps and What I would like to accomplish is to save extra data of that fields and see that data on admin backend of member section of umbraco cms.
What I have done so far in brief:
Created a user control using asp.net createuserwizard and save it to umbraco.
I also added a macro into usercontrol which pulls its data from dropdown list multiple render control data type which has some prevalues.
After selecting values and creating user, none of the selected values of dropdown list multiple render control data type are selected on admin backend but address are successfully saved.
Code behind file:Roles.AddUserToRole(UserName.Text, "BasicUsers");var profile = System.Web.Profile.ProfileBase.Create(UserName.Text);profile["sector"] = Sector.SelectedItem.Value;profile["address"] = Address.Text;profile.Save();
That relevant code snippet above works well like profile["address"] = Address.Text; but I am unable to save with other renders controls as Dropdown list multiple.
View 4 Replies
Similar Messages:
Sep 26, 2010
I am new to asp.net's membership controls. I am trying to figure out how to make a public profile page that will display information about a site member to other users. I thought I would be able to use the profile class and just pass in a parameter such as user name. But I tried:
Profile.GetProfile("username")
'Where username = name of profile I want to retrieve
Response.Write(Profile.Title)
Response.Write(Profile.Company)
However, if the user is logged in this codee just brings back their details, not those of the username requested. What am I doing wrong?
View 4 Replies
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
Jun 16, 2010
I know you can add defaultValues using the web.config like this:
<profile>
<properties>
<add name="AreCool" type="System.Boolean" defaultValue="False" />
</properties>
</profile>
but I have the Profile inherited from a class:
<profile inherits="CustomProfile" defaultProvider="CustomProfileProvider" enabled="true">
<providers>
<clear />
<add name="CustomProfileProvider" type="CustomProfileProvider" />
</providers>
</profile>
Heres the class:
Public Class CustomProfile
Inherits ProfileBase
Public Property AreCool() As Boolean
Get
Return Me.GetPropertyValue("AreCool")
End Get
Set(ByVal value As Boolean)
Me.SetPropertyValue("AreCool", value)
End Set
End Property
End Class
I don't know how to set the default value of the property. Its causing errors because without a default value, it uses an empty string, which cannot be converted to a Boolean. I tried adding <DefaultSettingValue("False")> _ but that didn't seem to make a difference.
I'm also using a custom ProfileProvider (CustomProfileProvider).
View 2 Replies
Jun 14, 2010
I was just wondering if anyone has ever had to port the schema across? Are there any experts that could pitch their opinions on the achievability of this (mad) idea? I'm using the IBM Migration Toolkit and as expected its throwing a bunch of translation errors some of which were relatively easy to solve (vendor specific function calls for example) and some will take quite a while to pin down and work round.... however this is not my main concern.
If completed I expect I am going to have to basically rework all the System.Web.Profile/Roles/Membership namespace classes etc to work round the SQL limitations of informix (i.e. IDS11.x SQL server doesnt have a DEFAULT (newguid()) so that would have to be put into the calling method) (and any MVP comments really as I can slap my boss round with the weight after he ludicrously agreed to this project for a client without doing any research...)
View 1 Replies
Mar 15, 2010
I know how to use Profile Shopping cart property with Web site but i can't use it with web application
if you can refere me to any post explains how to use Profile Shopping cart property with Web application.
For example if i used this code in web application does not work but it works in website!
[code]....
View 1 Replies
Feb 12, 2010
I need to delete the user email once user is loged in and clics Delete Email/ Address/ Tel. I store user information in profile.common
[Code]....
this gets me the current user, next i need to delete this users email/ phone.
View 1 Replies
Feb 4, 2011
I have not been able to save any profile information? All the tutorials seem straightforward but nothing works.
[Code]....
[Code]....
If I am using the default profile provider, why won't this work?
View 4 Replies
Jan 26, 2010
Is it possible to allow an administrator to write to a readonly profile property by redefining the profile property in a web.config file used for administrators pages?
I have a unique account number which must be assigned to each new user (using the default asp.net membership provider). After reading a couple of articles it seemed it would just be easier to define it as a profile property instead of creating a custom membership provider. When the user makes changes to their profile on a profile page I create, I want the value to be readonly. When an admin views the profile I actually want them to assign the value to the property in their page.
View 1 Replies
Oct 27, 2010
I have profile variable called IP Address ,
i need this Profile to add Unique IP address that has been used by the UserName ,,,
meaning :
If i logged in for the first time , it will save my IP address , next time if my IP has changed and i logged in , i need to keep the old IP address and add to it with comma seperated the new IP ..
View 1 Replies
Jul 27, 2010
I am using profiles it works fine but it is not saving in aspnet_profile table besides using save method
In Web Config:
<profile enabled="true" defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="dd"
applicationName="AJAXEnabledFor Master Page"/>
</providers>
<properties>
<add name= "FirstName" />
<add name= "LastName" />
<add name= "Address1"/>
<add name= "Address2"/>
<add name= "City"/>
<add name= "State"/>
<add name= "Country"/>
<add name= "PinCode"/>
<add name= "Contact"/>
</properties>
</profile>
In Code Behind File
if (CreateUserWizard1.ActiveStep.Title == "Complete")
{
Roles.AddUserToRole(CreateUserWizard1.UserName, "Guest");
ProfileCommon p = (ProfileCommon)ProfileCommon.Create(CreateUserWizard1.UserName, true);
WizardStep Details = CreateUserWizard1.FindControl("Details") as WizardStep;
p.FirstName = ((TextBox)Details.FindControl("TextBox1")).Text;
p.LastName = ((TextBox)Details.FindControl("TextBox2")).Text;
p.Address1 = ((TextBox)Details.FindControl("TextBox3")).Text;
p.Address2 = ((TextBox)Details.FindControl("TextBox4")).Text;
p.City = ((TextBox)Details.FindControl("TextBox5")).Text;
p.State = ((TextBox)Details.FindControl("TextBox6")).Text;
p.Country = ((TextBox)Details.FindControl("TextBox7")).Text;
p.PinCode = ((TextBox)Details.FindControl("TextBox8")).Text;
p.Contact = ((TextBox)Details.FindControl("TextBox9")).Text;
p.Save();
}
View 1 Replies
Mar 5, 2010
We have added some custom profile properties to the web.config - what we want to do is have the code access them once (when user logs in) and cache this so that the code doesn't have to hit the database each time we call Profile.<our custom profile property name>
What we see is a call to GetProperties or GetProfile each time we access Profile. <our custom profile property name> - whats the recommended way to do this?
View 4 Replies
Jul 19, 2010
I've been experimenting with the ASP.NET profile system and I like how easy it is to add data to the profile programmatically and how to access it again, all in a single line.
However, I've see the input that it sticks in the database and I'm not too keen on it.
I'd really like to create my own separate tables, so everything is nice and logical and easy to access, but I'd still like to be able to access this "profile" data as easily as I could with the ASP.Net profile system.
Should I create some kind of class in a separate class file that does all the hard work, then I can access the information from intellisense?
View 2 Replies
Jun 3, 2010
I'm still trying to learn how all of this works, and I apologize if this is a simple fix, but I'm getting frustrated and I could use some help.
I found an XML profile provider that I'm trying to use, and when I set it up, it works fine on my local machine. However when I upload it to the server, I get an error and I don't really know what it means:
Server Error in '/' Application.
Configuration Error
Description:
An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: CustomProviders.XmlProfileProvider..ctor()
Source Error:
[Code]....
Source File: E:kundenhomepages28d241331304web.config Line:
38
The full profile section from the web.config file is:
<profile enabled="true" defaultProvider="XmlProfileProvider">
<providers>
<clear/>
<add applicationName="FamilySite" name="XmlProfileProvider" type="CustomProviders.XmlProfileProvider"/>
</providers>
<properties>
<add name="FirstName" />
<add name="LastName" />
<add name="HomeTown" />
<add name="ShowEmail" type="System.Boolean"/>
</properties>
</profile>
View 2 Replies
Mar 19, 2010
We've been using the custom SQL table profile provider offered on the MSDN site.No problem configuring the new provider and saving profile values into our custom table while using the Create User Wizard.However, we cannot seem to be able to display the profile properties, using
[Code]....
The user is logged in, and there are no problems displaying all membership values and role values.
View 1 Replies
Aug 6, 2010
The week of torture and confusion at a higher level.I added a custom profile provider.
<profile defaultProvider="MySqlProfileProvider">
<providers>
<remove name="AspNetSqlProfileProvider"/>[code]...
I had to add the <remove name="MySqlProfileProvider"/>as it error with "the entry MySqlProfileProvider has already been made."The problem now is that it will only hold the data the first time I log in and create the account. Everything run find until you close the browser and try to log in the next time. Then the pages that use the profile properties tells me that there is no profile data for the same fields like there name for this user.It was there the first time and save it but the 2nd login it gone. Seems to me that the remove actually removes the data even when you save itI got it to work on the local server by setting MySqlProfileProvider up in using IIS managment tools. My local now rund fine. However my service provider will not make the manual entry for me.
View 14 Replies
Apr 23, 2010
I am trying to use a second (custom) table to extend my users profile info. This table is in the same database as the 'aspnet_Users' table but has a different name. I create a FK relationship between the 'aspnet_Users' table and my custom table. Here is my web.config code:
<profile defaultProvider="AspNetSqlMembershipProvider">
<providers>
<clear />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="ConString_SQLConnectionString"
applicationName="/" />
<add name="MyCustomProfile"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="ConString_SQLConnectionString"
applicationName="/"
table="MyProfileTable_Employees" />
</providers>
<properties>
<group name ="MyProfileInfo">
<add name="FirstName" type="string" defaultValue="[null]" customProviderData="FirstName;nvarchar" provider="MyCustomProfile" />
<add name="LastName" type="string" defaultValue="[null]" customProviderData="LastName;nvarchar" provider="MyCustomProfile" />
<add name="EmployeeNumber" type="int" defaultValue="[null]" customProviderData="EmployeeNumber;int" provider="MyCustomProfile" />
</group>
</properties>
</profile>
I have the table "MyProfileTable_Employees" poplulated with data the 'userid' matches to the aspnet_Users table. In my web application (vb), when I type in Profile.MyProfileInfo, there are no custom fields. Actually, when I type profile., there are no profile related entries. What am I missing here? Am I miss-interpting what a custom profile provider is?
View 2 Replies
May 8, 2010
So I'm using the CreateUserWizard tool, which is working great, and have added a few custom fields to the user's Profile, which is also working great... with one exception. The fields that I'm capturing from TextBoxes are being saved to the database perfectly. But those I'm trying to capture from DropDownLists aren't being saved. No error is taking place, either in my code or at runtime, but no data is being written to the table from these particular fields.
I thought I knew how to capture data from a DropDownList in ASP.NET (I'm a newbie, but not ridiculously so), but I've tried a bunch of stuff here and nothing seems to be working. I'm posting an abbreviated version of my CreateUserWizard1_CreatedUser function below, with comments...
protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
//Get the profile of the user by finding the profile by name
TextBox oUserName = (TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("UserName");
[Code]....
View 2 Replies
Jul 8, 2010
I have a profile variable, and when I load it then it is assigned default values. I need to check to see if it has ever been assigned. Typically I'd use an is null comparison but that won't work.
It was suggested I use the FindProfilesByUserName which seems backward. Regardless this method wont work as it only tells me if the user has any profile created but not for the specific member data I'm interested in. (It seems backwards because the whole purpose of the profiles was to make it easy to access the current user profile data. This seems like a bad design unless I'm missing something.)
The last option I can see is assigning bits to every object to see if they were dirtied or set. I don't want to do this unless required though.
Here is the FindProfilesByUserName sample :
ProfileInfoCollection profileInfo = ProfileManager.FindProfilesByUserName(ProfileAuthenticationOption.All, Membership.GetUser().UserName);
if (profileInfo.Count > 0)
{
if (profileInfo[Membership.GetUser().UserName] != null)
View 2 Replies
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
Sep 29, 2010
I try to construct a membership system using Walkthrough: Creating a Web Site with Membership and User Login. The membership system is going to be added to umbraco cms. I should admit that I am still in the learning process and need your guidance for my question.On my registration page other than standard fields which comes with CreateUserWizard, I need to add some extra fields in addition to that and those fields should be saved to database along with standard fields. Is it possible? If it is, how can I manage to do that?
View 3 Replies
Mar 10, 2010
I have added some profile properties to my web.config:
<profile automaticSaveEnabled ="true">
<properties>
<add name="NumVisits" type="System.Int32"/>
<add name="UserName" type="System.String"/>
<add name="Gender" type="bool"/>
<add name="Birthday" type="System.DateTime"/>
</properties>
</profile>
However when I try to access the property in a code behind it does not exist. The following code does not work (says firstname is not a property):
Profile.Gender And In the Asp.net Configuration 'Profile tab ' Is not showing. I have rebuilt the solution. I am using VB.NET(3.5)
View 1 Replies
Mar 25, 2010
I am trying to make an asp.net website using Visual web dev and C# that accesses data in an SQL database. For my site, I need to be able to save and access additional user properties such as age and gender. I have been playing around with the built in .NET Login tools but I don't understand how to keep track of the additional properties (age, gender...) I could store all the users information in my own database but how do I correlate the users data in my DB to the usernames in the member database that is automatically created?
View 2 Replies
Mar 20, 2011
Possible Duplicate: How to assign Profile values?I want to save some values in Profile in asp.net MVC controller, How can I access the profile object in controller ? What namespace Do I need to add. I have added few name value pairs under profile section in web.config.
View 1 Replies
Sep 15, 2010
So what I'm trying to accomplish is this
[Code]....
The user control has public properties named accordingly and the page has protected properties accordingly which I've verified have the desired values.
For some reason the values are always empty strings or 0s in the usercontrol, no matter what the page property is.
View 1 Replies