I would like to have a new registered user to become a "Friend" automatically. I have a folder that i want people to have instant access to once they have created an account.
Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs)
Roles.AddUserToRole(CreateUserWizard1.UserName, "friend")
End Sub
Hope it helps
Regards
Jeremy
If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
That way future readers will know which post solved your issue.
Regards
Jeremy
If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
That way future readers will know which post solved your issue.
Did you add OnCreatedUser="CreateUserWizard1_CreatedUser" to the asp:CreateUserWizard ?
Regards
Jeremy
If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
That way future readers will know which post solved your issue.
Member
3 Points
41 Posts
Make New User default to Friend
Oct 19, 2007 02:51 PM|fishmore|LINK
I have been working on this problem all day.
I would like to have a new registered user to become a "Friend" automatically. I have a folder that i want people to have instant access to once they have created an account.
new users - Administration tool
Contributor
5190 Points
1469 Posts
Re: Make New User default to Friend
Oct 20, 2007 08:33 AM|jeremyh|LINK
Add the role to your create user wizard like so
Jeremy
If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
That way future readers will know which post solved your issue.
Member
3 Points
41 Posts
Re: Make New User default to Friend
Oct 22, 2007 08:59 AM|fishmore|LINK
Thanks, that looks right, but where do i put it?
I tried adding it to the back code on my register.aspx.cs but i recieved errors. keep in mind i am using C#.
thanks for your help
Contributor
5190 Points
1469 Posts
Re: Make New User default to Friend
Oct 22, 2007 10:49 AM|jeremyh|LINK
Sorry missed the c# bit here you go, just add to your .cs page and all should be well
Hope it helps
Jeremy
If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
That way future readers will know which post solved your issue.
Member
3 Points
41 Posts
Re: Make New User default to Friend
Oct 22, 2007 11:32 AM|fishmore|LINK
Still hasn't worked. I tried two different ways. The first ran ok, but I didn't get the correct results.
And the second try returned an error.
do you see anything wrong?
Member
3 Points
41 Posts
Re: Make New User default to Friend
Oct 22, 2007 11:43 AM|fishmore|LINK
My screen shors didn't work so here is the two codes,
using
System;using
System.Data;using
System.Configuration;using
System.Web;using
System.Web.Security;using
System.Web.UI;using
System.Web.UI.WebControls;using
System.Web.UI.WebControls.WebParts;using
System.Web.UI.HtmlControls; public partial class Register_aspx : System.Web.UI.Page {{
Roles.AddUserToRole(CreateUserWizard1.UserName, "Friend");}}
that one ran, but with no results. here is the second one.
}
protected void CreateUserWizard1_CreateUser(object sender, System.EventArgs e){
Roles.AddUserToRole(CreateUserWizard1.UserName, "Friend");}
Contributor
5190 Points
1469 Posts
Re: Make New User default to Friend
Oct 22, 2007 12:49 PM|jeremyh|LINK
Did you add OnCreatedUser="CreateUserWizard1_CreatedUser" to the asp:CreateUserWizard ?
Jeremy
If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
That way future readers will know which post solved your issue.
Member
3 Points
41 Posts
Re: Make New User default to Friend
Oct 22, 2007 01:33 PM|fishmore|LINK
I got it now!!
Thanks, it works great!