CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: NewsGroup Date Entered: 8/27/2004 1:10:17 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 14 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
ruthereno
Asp.Net User
Profile Saving8/27/2004 1:10:17 PM

0/0

Hi I am trying to request some user information during registration process in addition to e-mail and password. I am able to create the user and authenticate him using ValidateUser function of Membership class. After that I am assigning values to Profile and saving. During assignment I am getting Exception that this can not happed to Anonymous users. I don't want anonymous authentication enabled. Please see the following code. What am I doing wrong. Am I missing some step!?

Thank you in advance.
Register.aspx

Dim newUser As MembershipUser
Dim createStatus As MembershipCreateStatus
newUser = Membership.CreateUser(Email.Text, Password.Text, Email.Text, Question.SelectedItem.Value, Answer.Text, True, createStatus)
If newUser Is Nothing Then
Status.Text = GetErrorMessage(createStatus)
Else
Membership.ValidateUser(Email.Text, Password.Text)
FormsAuthentication.SetAuthCookie(Email.Text, True)
Response.Redirect("Profile.aspx")
Profile.GetProfile(Email.Text)
Profile.Account = Me.tbAccount.Text
Profile.AddressLine1 = Me.tbAddress1.Text
Profile.AddressLine2 = Me.tbAddress2.Text
Profile.AddressLine3 = Me.tbAddress3.Text
Profile.City = Me.tbCity.Text
Profile.CustomerName = Me.tbCustomerName.Text
Profile.FirstName = Me.tbFirstName.Text
Profile.LastName = Me.tbLastName.Text
Profile.Phone = Me.tbPhone.Text
Profile.State = Me.tbState.Text
Profile.Zip = Me.tbZip.Text
Profile.Save()
End IF

My Web.config is

<membership defaultProvider="AspNetAccessProvider"/>
<profile enabled="true">
<properties>
<add name="FirstName" type="System.String" />
<add name="LastName" type="System.String" />
<add name="AddressLine1" type="System.String" />
<add name="AddressLine2" type="System.String" />
<add name="AddressLine3" type="System.String" />
<add name="City" type="System.String" />
<add name="State" type="System.String" />
<add name="Zip" type="System.String" />
<add name="Country" type="System.String" />
<add name="Phone" type="System.String" />
<add name="Account" type="System.String" />
<add name="CustomerName" type="System.String" />
</properties>
</profile>
<location path="Register.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>

I have to use location config becuase anonymous users can access this page and register.

Any thoughts appreciated.


ruthereno
Asp.Net User
Re: Profile Saving8/27/2004 1:27:56 PM

0/0

Hi Ignore line Response.redirect("Profile.aspx")
Fredrik N
Asp.Net User
Re: Profile Saving8/27/2004 1:37:15 PM

0/0

The Profile feature uses an HttpModule to load the Profile data for the authenticated user. So when you have authenticated the user (Set the auth cookie) the Profile do not yet know about the User until the http module is executed again. An HttpModule will be used before the page is processed.

Instead of creating your own form, take a look at this post on my blog, it will describe how your can use the CreateUserWizard and set the Profiles for a authenticated user.
/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
ruthereno
Asp.Net User
Re: Profile Saving8/27/2004 2:29:26 PM

0/0

Thank You. That Worked. I missed the HttpModule piece. Thank you again.
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Web Development, Silverlight, and ASP. NET AJAX: From Novice to Professional Authors: Laurence Moroney, Pages: 427, Published: 2008
Programming ASP.NET AJAX Authors: Christian Wenz, Pages: 454, Published: 2007
Annual World Bank Conference on Development Economics 2000 Authors: World Bank, Boris Pleskovic, Nicholas Stern, Pages: 448, Published: -1
The Analysis of Household Surveys: A Microeconometric Approach to Development Policy Authors: Angus Deaton, Pages: 479, Published: 1997
Taxation: Critical Perspectives on the World Economy Authors: Simon James, Pages: 1600, Published: 2002
Color Confidence: The Digital Photographer's Guide to Color Management Authors: Tim Grey, Katrin Eismann, Pages: 252, Published: 2004
Color Management for Photographers: Hands on Techniques for Photoshop Users Authors: Andrew Rodney, Pages: 463, Published: 2005
SAP R/3 Handbook: Essential Skills for Database Professionals Authors: Jose Hernandez, Jose Antonio Hernandez, Franklin Martinez, Jim Keogh, Pages: 606, Published: 2005
Mac OS X, Tiger Edition: The Missing Manual Authors: David Pogue, Pages: 847, Published: 2005

Web:
Tutto .NET: Possible pitfalls of Automatic profile saving that you ... To cancel the automatic profile save operation, set the ContinueWithProfileAutoSave property to false in the ProfileAutoSaving event; otherwise, ...
In Profile: Saving Alaska's Salmon | The Conservation Fund In Profile: Saving Alaska's Salmon. Send to a Friend. A $4.5 million grant from the Gordon and Betty Moore Foundation enabled The Conservation Fund to ...
miniaim Forum / Profile Saving Profile Saving. I'm using miniaim v0.3.0594b and everytime I open up the application, my buddy info is replaced by the default e-mail and link to the ...
Profile Saving - ASP.NET Forums After that I am assigning values to Profile and saving. During assignment I am getting Exception that this can not happed to Anonymous users ...
feedmap.net - Blog Profile : Saving is Easy Want to save money on your favorite products? Click here to join Eversave, and you will receive FREE samples, money-saving coupons, and exclusive offers ...
Profile: Saving the planet, one camel at a time - The Register ... May 4, 2005. Profile: Saving the planet, one camel at a time ... Guard Profile, send your idea to Jim Murez at [email protected] or ...
Investor Profile: Saving & Making Ends Meet EdVest and tomorrow's scholar are state-sponsored 529 college savings plans administered by the Wisconsin Office of the State Treasurer. ...
Artist Profile - Saving Abel - Videos Jango is about making online music social, fun and simple. Free personal radio that learns from your taste and connects you to others who like what you ...
Wise Bread Forums - View Profile: saving maglet saving maglet is a Junior Member in the Wise Bread Forums. View saving maglet's profile.
Saving and loading working space profiles Saving your custom profile ensures that you can reuse it and share it with other users and other Adobe applications that use the Color Settings dialog box. ...

Videos:
How to save on gears of war with now user profile! Link: http://www.megaupload.com/?d=EPCIFDFV This may help others with their saving issues with gears of war!
50. Saving Your Profile - Blogger 2.0 http://magicwithblogs.blogspot.com/ has the other 117 Blogger training videos. This video will show you how to save your Blogger profile.
Saving Cornland Two terrorists need one final ingredient to finish the ultimate Weapon of Mass Destruction, bubble gum! Only one girl has what they need due to the A...
Sexy Jobs: Saving Money For China & US..!! Finished uni and now need to save to visit China and & America... Check out this cool cat.. http://www.youtube.com/user/johnreagannumber1 Follow m...
93: MS Beluga SkySails, BoatTest Reports, Fuel Saving Tips for Boaters First up, let's see what's making waves in Nautical News... The MS Beluga SkySails uses a computer controlled kite to help carry it across the water....
Thirteen - Saving Version two (you can find version one on my profile) Movie: Thirteen Music: Saving by Thirteen senses I liked this song a little better than the one...
Career Profile - Coast Guard The Coast Guard is an organization made up of people that have a desire to save peoples lives.
Valkyrie Profile - Gabriel Celeste Was bored, so I decided to load up my old Valkyrie Profile save. All my characters here are level 99 with pretty much the best gear, and Lenneth has...
Saving Private Ryan Music Video Music : System Of A Down - Soldier Side Video : Saving Private Ryan Edited By: Killa27 http://www.youtube.com/profile?user=killa27 DOWNLOAD AVAILABL...
Naruto characters profile: Tenten Hi! this is a character profile, i will make one of all characters (only the ones that i like :P), but if you like to see you fave character profile,...




Search This Site:










i tried to modify the look of the header.ascx file in dw (as visual studio is a pain) but now the search feature wont work

tableless skins, css, xhtml and dnn 3.x

can't create web service item

reading a value from a dynamically loaded user control

blocking embedded javascript

maintain absolute web page security

changing the date colour bar?

dnn 2.0.3 error!

forms authentication messing up my web services

free tv listing module

two cookie paths ..??

css menu - list item height

master page and cross page postback

bad performance with large hierarchical structures in dnn3

3.0.12: bulk e-mail on wh4l - problems

having problem modifying controls with new dnn 2.0.1 and dnn 2.0.2

web setup project, check for ajax support in launch condition

dnn 4.0 & .net 2.0, sql2005 (sqlexpress) with sql server management studio express

3.0.13 issue: wizard (common tasks)

login for 1 file in subfolder

[argumentexception]: culture name neutral is not supported. error in all portals

startfromcurrentnode not working for custom sitemapprovider

tools?

help with membership provider

login page with sql validation...

loginstatus control problem

simple authentication without using the provided login control

dynamically linking the module through code

help implementing strongly typed style properties

usernametoken signing and encryption (oh, and java)

 
All Times Are GMT