<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Security</title><link>http://forums.asp.net/25.aspx</link><description>All about ASP.NET security (authentication, authorization, membership, roles, etc.) and the Login controls. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=24&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1646397.aspx</link><pubDate>Sun, 01 Apr 2007 10:50:58 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1646397</guid><dc:creator>mstubb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1646397.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1646397</wfw:commentRss><description>&lt;p&gt;This thread has gone on now for some time. Finally I have sorted out the problem. Just for anyone interested.&lt;/p&gt;
&lt;p&gt;The code I used in the aspx.vb is as follows: Whereby &lt;font color=#a31515&gt;"role" &lt;/font&gt;is the role name&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;Protected&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt; CreateWizard1_OnUserCrated(&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; sender &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Object&lt;/font&gt;&lt;font size=2&gt;, &lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; e &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; System.EventArgs) &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Handles&lt;/font&gt;&lt;font size=2&gt; CreateUserWizard1.CreatedUser&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;Dim&lt;/font&gt;&lt;font size=2&gt; userInfo &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; MembershipUser = Membership.GetUser(CreateUserWizard1.UserName)&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;userInfo.IsApproved = &lt;font color=#0000ff size=2&gt;True&lt;/font&gt;&lt;/p&gt;&lt;font size=2&gt;
&lt;p&gt;Membership.UpdateUser(userInfo)&lt;/p&gt;
&lt;p&gt;Roles.AddUserToRole(CreateUserWizard1.UserName, &lt;/p&gt;&lt;/font&gt;&lt;font color=#a31515 size=2&gt;"role"&lt;/font&gt;&lt;font size=2&gt;)
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1645859.aspx</link><pubDate>Sat, 31 Mar 2007 13:29:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1645859</guid><dc:creator>mstubb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1645859.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1645859</wfw:commentRss><description>&lt;p&gt;Hi You dont say where in the aspx.vb I needed to add the first bit of code. I am rapidly loosing my mind and loosing time.&amp;nbsp;All I want to do is use the default Create user Wizard and make every user a member of the user role. I dont want them to choose which role or anything flash like that. &lt;/p&gt;
&lt;p&gt;The new user must be able to join and then automatically be added to the user role. The Next thing I have to sort out is that before the registration is complete the user is taken to a payment gateway to pay for the yearly subscription for the site access.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can anyone please help me.&amp;nbsp;If anyone can spare the time to show me the whole code I need to add to the aspx and aspex.vb pages I would really appreicate it. &lt;/p&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1645129.aspx</link><pubDate>Fri, 30 Mar 2007 18:32:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1645129</guid><dc:creator>omerkamal</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1645129.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1645129</wfw:commentRss><description>&lt;ol&gt;
&lt;li&gt;Make sure your TextBox which take ths User Name is Called "&lt;strong&gt;UserName&lt;/strong&gt;".&lt;/li&gt;
&lt;li&gt;I think your TextBox Lied in the CreateUserWizard1. so replace the code like this:&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;dim username as string= CType(&lt;font size=2&gt;WizardCreateUser.CreateUserStep.ContentTemplateContainer.FindControl(&lt;/font&gt;&lt;font color=#a31515 size=2&gt;"&lt;strong&gt;&lt;font color=#000000&gt;UserName&lt;/font&gt;&lt;/strong&gt;"&lt;/font&gt;&lt;font size=2&gt;), TextBox).Text&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size=2&gt;dim&amp;nbsp;role as string= CType(&lt;font size=2&gt;WizardCreateUser.CreateUserStep.ContentTemplateContainer.FindControl(&lt;/font&gt;&lt;font color=#a31515 size=2&gt;"&lt;strong&gt;&lt;font color=#000000&gt;RoleName&lt;/font&gt;&lt;/strong&gt;"&lt;/font&gt;&lt;font size=2&gt;), TextBox).Text&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Roles.AddUserToRole(username,role)&lt;u&gt;;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;&lt;u&gt;Where:&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UserName&lt;/strong&gt; and &lt;strong&gt;RoleName&lt;/strong&gt; are the Text Boxes for &lt;strong&gt;User Name&lt;/strong&gt; and the &lt;strong&gt;Role Name&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Which&amp;nbsp;are added to &lt;strong&gt;ContentTemplate&lt;/strong&gt; of the &lt;strong&gt;CreateUserWizardStep. &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;See the .aspx Page side:&lt;/p&gt;
&lt;p&gt;&lt;font size=+0&gt;&lt;font size=2&gt;&lt;font color=#a31515 size=2&gt;&amp;nbsp;&lt;pre class=coloredcode&gt;&amp;lt;&lt;span class=tag&gt;asp:CreateUserWizard&lt;/span&gt;&lt;span class=attr&gt; ID=&lt;/span&gt;&lt;span class=attrv&gt;"WizardCreateUser"&lt;/span&gt;&lt;span class=attr&gt; runat=&lt;/span&gt;&lt;span class=attrv&gt;"server"&lt;/span&gt;&lt;span class=attr&gt; ContinueDestinationPageUrl=&lt;/span&gt;&lt;span class=attrv&gt;"~/Default.aspx"&lt;/span&gt;
&lt;span class=attr&gt;      OnCreatedUser=&lt;/span&gt;&lt;span class=attrv&gt;"WizardCreateUser_CreatedUser"&lt;/span&gt;&amp;gt;
       &amp;lt;&lt;span class=tag&gt;WizardSteps&lt;/span&gt;&amp;gt;
        &amp;lt;&lt;span class=tag&gt;asp:CreateUserWizardStep&lt;/span&gt;&lt;span class=attr&gt; ID=&lt;/span&gt;&lt;span class=attrv&gt;"CreateUserWizardStep1"&lt;/span&gt;&lt;span class=attr&gt;  runat=&lt;/span&gt;&lt;span class=attrv&gt;"server"&lt;/span&gt;&amp;gt;
          &amp;lt;&lt;span class=tag&gt;ContentTemplate&lt;/span&gt;&amp;gt;
              &amp;lt;&lt;span class=tag&gt;asp:TextBox&lt;/span&gt;&lt;span class=attr&gt; ID=&lt;/span&gt;&lt;span class=attrv&gt;"UserName"&lt;/span&gt;&lt;span class=attr&gt; runat=&lt;/span&gt;&lt;span class=attrv&gt;"server"&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class=tag&gt;asp:TextBox&lt;/span&gt;&amp;gt;
              &amp;lt;&lt;span class=tag&gt;asp:TextBox&lt;/span&gt;&lt;span class=attr&gt; ID=&lt;/span&gt;&lt;span class=attrv&gt;"RoleName"&lt;/span&gt;&lt;span class=attr&gt; runat=&lt;/span&gt;&lt;span class=attrv&gt;"server"&lt;/span&gt; &amp;gt;&amp;lt;/&lt;span class=tag&gt;asp:TextBox&lt;/span&gt;&amp;gt;
           &amp;lt;/&lt;span class=tag&gt;ContentTemplate&lt;/span&gt;&amp;gt;                           
         &amp;lt;/&lt;span class=tag&gt;asp:CreateUserWizardStep&lt;/span&gt;&amp;gt;
       &amp;lt;&lt;span class=tag&gt;asp:CompleteWizardStep&lt;/span&gt;&lt;span class=attr&gt; ID=&lt;/span&gt;&lt;span class=attrv&gt;"CompleteWizardStep1"&lt;/span&gt;&lt;span class=attr&gt; runat=&lt;/span&gt;&lt;span class=attrv&gt;"server"&lt;/span&gt; /&amp;gt;
       &amp;lt;/&lt;span class=tag&gt;WizardSteps&lt;/span&gt;&amp;gt;               
&amp;lt;/&lt;span class=tag&gt;asp:CreateUserWizard&lt;/span&gt;&amp;gt;       
&lt;/pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1644940.aspx</link><pubDate>Fri, 30 Mar 2007 16:08:07 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1644940</guid><dc:creator>mstubb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1644940.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1644940</wfw:commentRss><description>&lt;p&gt;Hi There&lt;/p&gt;
&lt;p&gt;Thanks for taking the time to reply to my question.&amp;nbsp;&amp;nbsp;My join.aspx.vb now looks like this, though now&amp;nbsp;with errors!!&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;Partial&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Class&lt;/font&gt;&lt;font size=2&gt; join&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;Inherits&lt;/font&gt;&lt;font size=2&gt; System.Web.UI.Page&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;Protected&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt; CreateUserWizard1_CreatedUser(&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; sender &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Object&lt;/font&gt;&lt;font size=2&gt;, &lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; e &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; System.EventArgs) &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Handles&lt;/font&gt;&lt;font size=2&gt; CreateUserWizard1.CreatedUser&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Roles.AddUserToRole(&lt;u&gt;UserName&lt;/u&gt;.Text, &lt;u&gt;RoleName&lt;/u&gt;.Text)&lt;u&gt;;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;End&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Class&lt;/font&gt;&lt;/p&gt;&lt;font color=#0000ff size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&lt;font color=#000000&gt;I now have blue wavy lines below the UserName and RoleName&amp;nbsp;and also below the ; at the end of the line after the ) I have shown it above using the underline to simulate what I can see. error smart tag messages for the two blue wavy lines are 
&lt;p&gt;&lt;strong&gt;Name 'UserName' is not declared&lt;br /&gt;&lt;/strong&gt;and &lt;br /&gt;&lt;strong&gt;Name 'RoleName' is not declared&lt;br /&gt;&lt;/strong&gt;and Finally&lt;br /&gt;&lt;strong&gt;Character not valid&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;All I want to do is use the default Create user Wizard and make every user a member of the user role. I am quickly loosing my mind. I really feel out of my depth and running out of time. Can anyone please help me.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1644936.aspx</link><pubDate>Fri, 30 Mar 2007 16:06:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1644936</guid><dc:creator>mstubb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1644936.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1644936</wfw:commentRss><description>&lt;p&gt;Hi There&lt;/p&gt;
&lt;p&gt;Thanks for taking the time to reply to my question.&amp;nbsp;&amp;nbsp;My join.aspx.vb now looks like this, though now&amp;nbsp;with errors!!&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;Partial&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Class&lt;/font&gt;&lt;font size=2&gt; join&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;Inherits&lt;/font&gt;&lt;font size=2&gt; System.Web.UI.Page&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;Protected&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt; CreateUserWizard1_CreatedUser(&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; sender &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Object&lt;/font&gt;&lt;font size=2&gt;, &lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; e &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; System.EventArgs) &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Handles&lt;/font&gt;&lt;font size=2&gt; CreateUserWizard1.CreatedUser&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Roles.AddUserToRole(&lt;u&gt;UserName&lt;/u&gt;.Text, &lt;u&gt;RoleName&lt;/u&gt;.Text)&lt;u&gt;;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;End&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Class&lt;/font&gt;&lt;/p&gt;&lt;font color=#0000ff size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&lt;font color=#000000&gt;I now have blue wavey lines below the UserName and RoleName&amp;nbsp;and also below the ; at the end of the line after the ) I have shown it above using the underline to simulate what I can see. error smart tag messages for the two blue wavey lines are 
&lt;p&gt;&lt;strong&gt;Name 'UserName' is not declared&lt;br /&gt;&lt;/strong&gt;and &lt;br /&gt;&lt;strong&gt;Name 'RoleName' is not declared&lt;br /&gt;&lt;/strong&gt;and Finally&lt;br /&gt;&lt;strong&gt;Chracter not valid&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;All I want to do is use the default Create user Wizard and make every user a member of the user role. I am quickly loosing my mind. I really feel out of my deapth and running out of time. Can anyone please help me.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1643818.aspx</link><pubDate>Thu, 29 Mar 2007 23:32:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1643818</guid><dc:creator>accelerator</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1643818.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1643818</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I think there could possibly be an error with this line:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Roles.AddUserToRole("UserName", "RoleName"); &lt;/p&gt;
&lt;p&gt;Looking at some code examples, I found the following for illustration, it will need modifying for your code:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Roles.AddUserToRole(Username.Text,&amp;nbsp;RoleList.SelectedItem.Value)&lt;/p&gt;
&lt;p&gt;Maybe yours should be:&lt;/p&gt;
&lt;p&gt;Roles.AddUserToRole(UserName.Text, RoleName.Text);&lt;/p&gt;
&lt;p&gt;The point I am trying to&amp;nbsp;make is that it might be that the way you have it at the moment, it is not reading the Text property of the UserName properly.&amp;nbsp; So say you try and create a UserName of Morgan, with&amp;nbsp;your existing code this is read as Username, but if you used "Username.Text" instead it would be correctly read as Morgan.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Rgds&lt;/p&gt;
&lt;p&gt;Accelerator&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1643715.aspx</link><pubDate>Thu, 29 Mar 2007 21:13:33 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1643715</guid><dc:creator>hypercode</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1643715.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1643715</wfw:commentRss><description>&lt;p&gt;First, do you have a Role created? If not, use the Web Site Administration Tool to create a Role.&lt;/p&gt;
&lt;p&gt;Then put this on the join.aspx.vb page:&lt;/p&gt;
&lt;p&gt;Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Roles.AddUserToRole("UserName", "RoleName"); &lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;.................&lt;/p&gt;
&lt;p&gt;Change RoleName in the Sub to the name of the Role that you created. Leave "UserName" as is.&lt;/p&gt;
&lt;p&gt;Go through&amp;nbsp;some tutorials on this stuff and then you'll understand it better. Here's a link to some tutorials:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/vstudio/express/beginner/reference/aspnet/default.aspx"&gt;http://msdn.microsoft.com/vstudio/express/beginner/reference/aspnet/default.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Good Luck&lt;/p&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1643434.aspx</link><pubDate>Thu, 29 Mar 2007 18:12:56 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1643434</guid><dc:creator>mstubb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1643434.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1643434</wfw:commentRss><description>&lt;p&gt;Hi sorry Iam still none the wiser. Thanks for your help and patients but this is really getting to me, to the point where I cannot get it to work and want to give up.&lt;/p&gt;
&lt;p&gt;I have started again and created a new page called join.aspx I have added the within the custom content a CreateUser Task Wizard using the default settings so it looks like this.&lt;/p&gt;&lt;font size=2&gt;
&lt;p&gt;&amp;lt;%&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;@&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#a31515 size=2&gt;Page&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;Language&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="VB"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;MasterPageFile&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="~/MasterPage.master"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;AutoEventWireup&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="false"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;CodeFile&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="join.aspx.vb"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;Inherits&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="join"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;title&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="Untitled Page"&lt;/font&gt;&lt;font size=2&gt; %&amp;gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#a31515 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#a31515 size=2&gt;Content&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;ID&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="Content1"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;ContentPlaceHolderID&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="ContentPlaceHolder1"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;Runat&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="Server"&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#a31515 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#a31515 size=2&gt;CreateUserWizard&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;ID&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="CreateUserWizard1"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;runat&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="server"&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#a31515 size=2&gt;WizardSteps&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#a31515 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#a31515 size=2&gt;CreateUserWizardStep&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;runat&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="server"&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;/&lt;/font&gt;&lt;font color=#a31515 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#a31515 size=2&gt;CreateUserWizardStep&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#a31515 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#a31515 size=2&gt;CompleteWizardStep&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;runat&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="server"&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;/&lt;/font&gt;&lt;font color=#a31515 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#a31515 size=2&gt;CompleteWizardStep&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;/&lt;/font&gt;&lt;font color=#a31515 size=2&gt;WizardSteps&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;/&lt;/font&gt;&lt;font color=#a31515 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#a31515 size=2&gt;CreateUserWizard&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/font&gt;&lt;font color=#a31515 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#a31515 size=2&gt;Content&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;The join.aspx.vb looks like this &lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;Partial&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Class&lt;/font&gt;&lt;font size=2&gt; join&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;Inherits&lt;/font&gt;&lt;font size=2&gt; System.Web.UI.Page&lt;/font&gt;&lt;/p&gt;&lt;font color=#0000ff size=2&gt;
&lt;p&gt;End&lt;/p&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Class&lt;/font&gt;
&lt;p&gt;What do I have to add to the code in the aspx. and aspx.vb pages so that I can ensure all new people who sign up become members of the user Role.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1641832.aspx</link><pubDate>Wed, 28 Mar 2007 21:50:10 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1641832</guid><dc:creator>hypercode</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1641832.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1641832</wfw:commentRss><description>&lt;p&gt;Take thisout out of the &amp;lt;asp&amp;gt; tag and try it: &lt;strong&gt;oncreateduser="CreateUserWizard1_CreatedUser&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:createuserwizard id="CreateUserWizard1" runat="server" &lt;strong&gt;oncreateduser="CreateUserWizard1_CreatedUser"&amp;gt;&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1641498.aspx</link><pubDate>Wed, 28 Mar 2007 18:28:56 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1641498</guid><dc:creator>mstubb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1641498.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1641498</wfw:commentRss><description>&lt;p&gt;Hi there&lt;/p&gt;
&lt;p&gt;Thanks for the prompt&amp;nbsp;reply, I would have answered sooner but I have been away. I added the code as you suggested but it did not like the ; after the ) so it looked like this &lt;/p&gt;
&lt;p&gt;Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Roles.AddUserToRole("UserName", "RoleName") &lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;However when I tested it I gor the following error&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;&lt;i&gt;The user 'UserName' is already in role 'user'.&lt;/i&gt; &lt;/h2&gt;
&lt;p&gt;&lt;font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "&gt;&lt;b&gt;Description: &lt;/b&gt;An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Exception Details: &lt;/b&gt;System.Configuration.Provider.ProviderException: The user 'UserName' is already in role 'user'.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Source Error:&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
&lt;table class="" bgColor=#ffffcc&gt;

&lt;tr&gt;
&lt;td class=""&gt;&lt;code&gt;&lt;pre&gt;Line 5:      Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser
Line 6:  
&lt;font color=red&gt;Line 7:          Roles.AddUserToRole("Username", "user")
&lt;/font&gt;Line 8:  
Line 9:      End Sub&lt;/pre&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;b&gt;&lt;font face=Verdana&gt;Source File: &lt;/font&gt;&lt;/b&gt;D:\Web Design\hush samples\Hush Star\createAccount.aspx.vb&lt;b&gt;&lt;font face=Verdana&gt; &amp;nbsp;&amp;nbsp; Line: &lt;/font&gt;&lt;/b&gt;7 &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1629419.aspx</link><pubDate>Wed, 21 Mar 2007 02:48:11 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1629419</guid><dc:creator>Zhao Ji Ma - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1629419.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1629419</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What is the error message?&lt;/p&gt;
&lt;p&gt;Since the function name is the event handler name, so you should tell the control which method is the handler in ASPX file:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:createuserwizard id="CreateUserWizard1" runat="server" &lt;strong&gt;oncreateduser="CreateUserWizard1_CreatedUser"&amp;gt;&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Please check this too.&lt;/p&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1629403.aspx</link><pubDate>Wed, 21 Mar 2007 02:20:17 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1629403</guid><dc:creator>hypercode</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1629403.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1629403</wfw:commentRss><description>&lt;p&gt;You can put it here. However, I used it in the "CreatingUser" event.&lt;/p&gt;
&lt;p&gt;Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Roles.AddUserToRole("UserName", "RoleName"); &lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1628812.aspx</link><pubDate>Tue, 20 Mar 2007 17:26:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1628812</guid><dc:creator>mstubb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1628812.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1628812</wfw:commentRss><description>&lt;p&gt;Hi Thanks for the reply. However Iam still a little confused.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;My CreatAcccount.aspx.vb code looks like this.Where do I add the code, as where ever I add it I get an error, ie wavy lines below the code.&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;Partial&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Class&lt;/font&gt;&lt;font size=2&gt; createAccount&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;Inherits&lt;/font&gt;&lt;font size=2&gt; System.Web.UI.Page&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;Protected&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt; CreateUserWizard1_CreatedUser(&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; sender &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Object&lt;/font&gt;&lt;font size=2&gt;, &lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; e &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; System.EventArgs) &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Handles&lt;/font&gt;&lt;font size=2&gt; CreateUserWizard1.CreatedUser&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;/p&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Protected&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub&lt;/font&gt;&lt;font size=2&gt; Password_TextChanged(&lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; sender &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Object&lt;/font&gt;&lt;font size=2&gt;, &lt;/font&gt;&lt;font color=#0000ff size=2&gt;ByVal&lt;/font&gt;&lt;font size=2&gt; e &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; System.EventArgs)
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Sub
&lt;p&gt;End&lt;/p&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Class&lt;/font&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1627797.aspx</link><pubDate>Tue, 20 Mar 2007 05:53:37 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1627797</guid><dc:creator>Zhao Ji Ma - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1627797.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1627797</wfw:commentRss><description>&lt;p&gt;you could add code to the createduser event like this of the wizard:&lt;/p&gt;&lt;font size=1&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;protected&lt;/font&gt;&lt;font size=1&gt; &lt;/font&gt;&lt;font color=#0000ff size=1&gt;void&lt;/font&gt;&lt;font size=1&gt; CreateUserWizard1_CreatedUser(&lt;/font&gt;&lt;font color=#0000ff size=1&gt;object&lt;/font&gt;&lt;font size=1&gt; sender, &lt;/font&gt;&lt;font color=#008080 size=1&gt;EventArgs&lt;/font&gt;&lt;font size=1&gt; e) 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;string&lt;/font&gt;&lt;font size=1&gt;[] usersArray = &lt;/font&gt;&lt;font color=#0000ff size=1&gt;new&lt;/font&gt;&lt;font size=1&gt; &lt;/font&gt;&lt;font color=#0000ff size=1&gt;string&lt;/font&gt;&lt;font size=1&gt;[1]; 
&lt;p&gt;usersArray[0] = CreateUserWizard1.UserName;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008080 size=1&gt;Roles&lt;/font&gt;&lt;font size=1&gt;.AddUsersToRole(usersArray, &lt;/font&gt;&lt;font color=#800000 size=1&gt;"Admin"&lt;/font&gt;&lt;font size=1&gt;); 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;a href="http://forums.asp.net/thread/1272697.aspx"&gt;http://forums.asp.net/thread/1272697.aspx&lt;/a&gt;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Membership Role Assignment through CreateUserWizard</title><link>http://forums.asp.net/thread/1626193.aspx</link><pubDate>Mon, 19 Mar 2007 08:26:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1626193</guid><dc:creator>mstubb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1626193.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1626193</wfw:commentRss><description>&lt;p&gt;Hi there&lt;/p&gt;
&lt;p&gt;This sort of answers a question I was going to ask but can you provide more info as to where you put this line of code. Iam currently building my site on the back&amp;nbsp;of the Job Site starter kit. Currently&amp;nbsp;I have no option but to keep the drop down for the user to select&amp;nbsp;which role,&amp;nbsp;when I only ever want all users to be in one role. I did try and take away this option but the page brought up errors, so I have just left it in.&lt;/p&gt;
&lt;p&gt;I would appreciate your help.&lt;/p&gt;</description></item></channel></rss>