473,732 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

create user using personalization

9 New Member
i m trying to create a user and add a role to the user and also add its personalization like first name and last name, all at the same time but there is a problem with the personalization .
Since on the point i create the user its anonymous but is there a way to get the user from the database so that when i add the personalization it is not anonymous.

This is my codes in VB

Public Sub CreateUser_OnCl ick(ByVal sender As Object, ByVal args As EventArgs) Handles CreateUserButto n.Click
Dim result As MembershipCreat eStatus
Try

' Create new user.

Dim newUser As MembershipUser

newUser = Membership.Crea teUser( _
UsernameTextbox .Text, _
PasswordTextbox .Text, _
EmailTextbox.Te xt)

Roles.AddUserTo Role(UsernameTe xtbox.Text, DropDownList1.S electedValue)

Profile.FirstNa me = TextBox1.Text
Profile.LastNam e = TextBox2.Text
Profile.Approve Limit = TextBox3.Text
Profile.Status = TextBox4.Text

Response.Redire ct("login.aspx" )


Catch e As MembershipCreat eUserException
Msg.Text = GetErrorMessage (e.StatusCode)
Catch e As HttpException
Msg.Text = e.Message
End Try
End Sub
Jun 25 '07 #1
1 1229
kenobewan
4,871 Recognized Expert Specialist
There's a clear relationship between user accounts and profile data. In fact, a personalization layer is mostly useful in applications that require users to register and log in. Here is an article that may help:
Personalization and User Profiles in ASP.NET 2.0
Jun 25 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1170
by: Danny Tuppeny | last post by:
Hi all, I'm after some advice... I'm building a website which will have a login etc.. The Personalization in asp.net 2 stuff looks like it'll save me some time (login controls etc.), however, the rest of my site ties very intimately into my users. I have many tables (such as News, PhotoGallery, ForumPost) which have a UserID column. From a user, I want to be able to get at a List<News>, List<PhotoGallery> etc.
4
4857
by: Sylvan | last post by:
I am new with this personalization stuff. Everything was working fine, however, now I always get the Login failed for user ''. The user is not associated with a trusted SQL Server connection. error message. This is for anonymous personalization, very simple. I am just trying to retrieve a string from Profile. This is what I have in my web.config file: <system.web>
1
2314
by: VB Programmer | last post by:
I am using personalization/profile to store info for the user that is not contained in the aspnet_Users or aspnet_Membership tables. This info includes, firstname, lastname, and phonenumber. On my "signup" page I ask for all their info at one time, including username, password, firstname, lastname, etc.... After I do a Membership.CreateUser and Roles.AddUserToRole I want to store the profile information. But, the code still thinks...
0
1572
by: Anonieko | last post by:
Scenario: Web Parts features (like design mode) require the user to be authenticated and registered. But what if you don't want the users to go through registration but still enable personalization? Answers:
0
1043
by: arthernan | last post by:
I have an almost finished page that uses webparts. And this is the expected functionality. A logged on user hits a button and the button opens a WebPart. Then te user logs off, next time he logs on he will find the webpart already open. Now, if a different user logs on, the fact that another user might have opeed a webpart should not affect the page. For him the page should only show webparts that were open inside his session. So this is...
2
1649
by: arthernan | last post by:
I have an almost finished page that uses webparts. And this is the expected functionality. A logged on user hits a button and the button opens a WebPart. Then the user logs off, next time he logs on he will find the webpart already open. Now, if a different user logs on, the fact that another user might have opened a webpart should not affect the page. For him the page should only show webparts that were open inside his session. This is...
0
1328
by: PaulOak | last post by:
Hi all, I have the following problem: 1. web site (asp.net 2.0 C#). 2. WebPartZone, which contains one user control. 3. SQL Server 2000 running on dedicated DB server, hosting the aspnetdb database. Configured with aspnet_regsql.exe tool 4. Using Impersonation 5. Web.config:
3
2360
by: Electrified Research | last post by:
So I've been playing with WebParts. Very cool stuff. The personalization scope has "Shared" and "User". "Shared" allows for an admin to customize a page and how other users see that page. "User" allows for that user to customize a page how they specifically want. What I want to do is a fusion of the the two. The personaliztion settings appear to be based on the request path. For example. /Default.aspx and /MyPage.aspx can have...
2
1563
by: Kees de Winter | last post by:
Hi, I am thinking about using the personalization features of .net 2.0 but I can't figure out the following. If I use the standard features of personalization, I will have users in the auto-generated profile-tables. But I have my own user tables with many more fields. How do I sync these users with the profile tables? I have thousands of users in my tables but if I can't use these tables for personalization it seems quite useless... ...
0
8944
marktang
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...
0
8773
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9306
jinu1996
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...
0
9180
tracyyun
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...
0
6030
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4805
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3259
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2177
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.