Hello,
I have a profile with multiple profile properties in my Web.Config:
<add allowAnonymous= "false" name="Contact" type="Contact"
serializeAs="Bi nary"/>
<add allowAnonymous= "false" name="Options" type="Options"
serializeAs="Bi nary"/>
Where each profile property is class, as follows:
<Serializable() _
Public Class Contact
Inherits ProfileBase
' City
Public Property City() As String
Get
Return CType(Me("City" ), String)
End Get
Set(ByVal value As String)
Me("City") = value
End Set
End Property ' City
...
End Class
I am creating a new profile to a user which I just created as follows:
Dim myContact As Contact = CType(ProfileBa se.Create(usern ame), Contact)
With myContact
.City = tbCity.Text
...
End With
contact.Save()
My question is:
Do I need to repeat this code to all my profile properties or is there
a better way to do this?
I have been Goggling for information on how to create a new profile for
a user which have been just created where there are various properties
and all them are custom classes.
Any advice would be great.
Thanks,
Miguel 1 1359
If you are making individual classes that store in profile, you will have to
work each one separately and add to profile. You can get around repeating
this in multiple locations, by setting up a class that holds the
save/retrieve profile information, but you will still have to have the code
for each class you are serializing into the profile.
Hope I answered the question you were asking. :-)
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA http://gregorybeamer.spaces.live.com
*************** *************** **************
Think outside the box!
*************** *************** **************
"shapper" <md*****@gmail. comwrote in message
news:11******** **************@ 38g2000cwa.goog legroups.com...
Hello,
I have a profile with multiple profile properties in my Web.Config:
<add allowAnonymous= "false" name="Contact" type="Contact"
serializeAs="Bi nary"/>
<add allowAnonymous= "false" name="Options" type="Options"
serializeAs="Bi nary"/>
Where each profile property is class, as follows:
<Serializable() _
Public Class Contact
Inherits ProfileBase
' City
Public Property City() As String
Get
Return CType(Me("City" ), String)
End Get
Set(ByVal value As String)
Me("City") = value
End Set
End Property ' City
...
End Class
I am creating a new profile to a user which I just created as follows:
Dim myContact As Contact = CType(ProfileBa se.Create(usern ame), Contact)
With myContact
.City = tbCity.Text
...
End With
contact.Save()
My question is:
Do I need to repeat this code to all my profile properties or is there
a better way to do this?
I have been Goggling for information on how to create a new profile for
a user which have been just created where there are various properties
and all them are custom classes.
Any advice would be great.
Thanks,
Miguel This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Shimon Sim |
last post by:
Hi
I am working on application that need to hold custom user information - Last
and first name, email, some other domain related information.
I used to create Base class for all my pages. The base class would have
CurrentUser property that would hold customer class in session and that was
fine for all my situations.
Now ASP.NET 2.0 came and we have Profile property for pages that could be
extended with configuration to have custom...
|
by: va |
last post by:
I realize that ASP.NET profile provider is used to create a strongly typed
storage of data that can be used like Session variables but can survive
beyond sessions.
In my ASP.NET 2.0 application, I am thinking of using the ASP.NET profile
provider and its the binary storage capability to store a lot of my user's
custom variables versus rolling my own object storage and access in a
database.
Are there any limits or warnings I should be...
|
by: Brent Borovan |
last post by:
Hello,
We have an ASP.NET application which uses the new Profile feature of ASP.NET
2.0 to maintain user profile information. As part of the software system we
are developing, we need to access the profile information from a separate
Windows application and/or service.
The Profile is a part of the System.Web name space and we are not sure how
to go about accessing the profile data from non-web applications. Anyone
have any advice on...
|
by: Tom |
last post by:
I'd greatly appreciate advice and code snippets on how to create a ram
disk within a C/C++ program.
I also need to be able to determine the free space.
Thanks in advance for any help.
|
by: Jeff |
last post by:
Hey
ASP.NET 2.0
I'm developing a web portal where users must login to. As far as I know all
users are accessible from the MembershipUserCollection. I know that current
user is also accessible via the Profile object in the webpage, but I want to
access the properties of one of the other users. So I guess I have to create
an instance of the ProfileCommon class... I have the username of the user I
want to create a ProfileCommon object...
| |
by: Darius |
last post by:
Hello
I implemented custom profile provider based on the example at
http://msdn2.microsoft.com/en-us/library/ta63b872.aspx. It reads Profiles
values from tables in Sql Server.
Everytime when I read Profile property (e.g. string Name =
Profile.FirstName) GetPropertyValues function is called. However after this
function SetPropertyValues is also called. It does not make sense why this
method should be called even if I do not update...
|
by: shapper |
last post by:
Hello,
On the web site I am working I have multiple profile properties, being
each one a custom class:
<add allowAnonymous="false" name="Personal"
type="MyWebSite.Profile.Collaborator" serializeAs="Binary"/>
<add allowAnonymous="false" name="Contacts"
type="MyWebSite.Profile.Contact" serializeAs="Binary"/>
<add allowAnonymous="true" name="Settings"
|
by: Nick |
last post by:
Hi there,
I have a web site, with a web service in folder within the website.
Everything works as I would expect it to. I have just added some
functionality to the web service that accesses a user profile and then
updates one of the settings then saves the profile. No exceptions occur
during this process and as far as I can see it all completes as expected.
Unfortunately the setting remains at its previous value.
I'm use an almost...
|
by: shapper |
last post by:
Hello,
On my CMS I am signed as administrator and I am creating a Membership
user and its profile:
MembershipCreateStatus status;
MembershipUser user = Membership.CreateUser("Joe", "Pass",
"Joe@email.com", null, null, true, null, out status);
if (user != null) {
ProfileHelper profile =
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |