Can't Modify Contact Details for users

Topics: Help
Jun 25, 2007 at 8:47 PM
Hello.

I have my CSK 2.0 up and running. Thanks to everyone involved for the excellent club site system. Also, thanks for all of the help from these forums.

When i login in as a user with Editor Role and attempt to Modify Contact Details, after clicking the Update Info button, it displays the icon that has a circular arrow and never does anything else. It does the same thing for an Administrator, but it does update the details.

In the source code for the Member/Details.aspx/InitPageData sub routine, i found this paragraph:

If dt.Rows.Count = 1 Then
Dim mr As DataSet.MemberInfoRow = dt(0)
UserName.Text = user.UserName
fname.Text = mr.firstname
lname.Text = mr.lastname
Email.Text = user.Email
Addr.Text = mr.address
Phone.Text = mr.phone
If mr.newsletter = True Then
NewsletterCheck.Checked = True
Else
NewsletterCheck.Checked = False
End If
If Not mr.IsAvatarSizeNull Then
avatarimage.ImageUrl = "~\UserControls\AvatarImagefetch.ashx?Memberid=" & user.ProviderUserKey.ToString

End If
End If

Should the first line say "If dt.Rows.Count > 1 Then" instead of "= 1"?

It would make sense to me and i will probably try it, but i wanted to see if i am on the right track or if anybody else had any other ideas.

Any help would be gratefully appreciated.

Thanks,
Tony
Coordinator
Jun 25, 2007 at 9:31 PM
No... it should be = 1. If it is > 1, then 1 wouldn't work.

You should be able to edit member details without any role. I'm not sure why it isn't working.

This might be fixed in the latest builds (as they use SubSonic instead of the VS DAL).
Jun 25, 2007 at 10:11 PM

z2bass wrote:
No... it should be = 1. If it is > 1, then 1 wouldn't work.

You should be able to edit member details without any role. I'm not sure why it isn't working.

This might be fixed in the latest builds (as they use SubSonic instead of the VS DAL).


I guess i meant to say ">= 1" or "> 0".

I set a breakpoint on the line after the If Then line. It never stops there when users other than the Administrator try to Modify Contact Details.

So if it never executes that logic for non Administrators, is that the way it was designed?

Thanks,
Tony
Coordinator
Jun 26, 2007 at 12:12 AM
No. All members should be able to update their own contact details. It should work out of the box. Have you made any changes to that? Or have you deleted the dataset in the App_Code folder?
Jun 26, 2007 at 1:01 AM

z2bass wrote:
No. All members should be able to update their own contact details. It should work out of the box. Have you made any changes to that? Or have you deleted the dataset in the App_Code folder?


The only changes i made were to change the verbage of the pages, web.config, web.sitemap and added some folders and pages.

I made no changes to any code and deleted nothing.

If i deleted the dataset, would the website allow me to login and add news items?

Thanks,
Tony
Coordinator
Jun 26, 2007 at 3:31 AM
The site would still allow you to edit news and login if you deleted the dataset.
Jun 26, 2007 at 4:34 PM

z2bass wrote:
The site would still allow you to edit news and login if you deleted the dataset.


I just want tothank you for all of your help. The way that you respond to posts so quickly is very much appreciated. I have learned so much from your replies to me and others in this discussion group.

I'm not sure of why my site is having these problems. I need to know more about ASP web sites.

Thanks,
Tony
Aug 23, 2007 at 1:36 AM
Tony,

Did you ever get this issue resolved? I'm having the same problem.

Thanks,
Kevin
Aug 23, 2007 at 3:00 AM
Hi All,

Ditto for me...I've got the same issue and can't figure it out. Anyone find out what this might be?

Thanks!
Sep 16, 2007 at 2:18 AM
Hi all,
Ditto for me and it is on my "to do" list to figure out. Anyone figure this out so I can save some thinking time?
Thanks in advance.
Deborah
Jan 31, 2008 at 7:12 PM
I found out that if you add a profile field, it must be assigned a value in the Register.aspx and Details.aspx page, otherwise the update never occurs (i.e., can't accept Null values). We have some profile values that the user should not update, but the StarterKit will not accept a null value for that field, so I simply set programmatically on the Updating event (kluggy, I admit, but I am a novice here and it works.)

Protected Sub dvEditMem_ItemUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdateEventArgs)
e.NewValues("yourVariableName") = some value
End Sub


Deborah
Feb 8, 2008 at 3:40 AM
Deborah,

I'm having trouble finding the sub "dvEditMem_ItemUpdating" in my site; 2.0RC. Can you clarify...
Feb 8, 2008 at 4:57 PM
Edited Feb 8, 2008 at 4:59 PM
I might have changed the details view name on my website, so that is why you can't find it. I'll try to be clearer:

1. Add membership field(s) as shown on the Codeplex documentation http://www.codeplex.com/ClubStarterKit/Wiki/View.aspx?title=Adding%20a%20membership%20field&referringTitle=Documentation You may also have to look at the SubSonic directions for the Express or Standard editions of Visual Web Developer. (It is not hard - just carefully follow the directions).

2. On your details (or register) page, click on the details view table where you placed your new fields for users to enter. Look for the ID name (I must have called mine dvEditMem for DetailsViewEditMember - I may have changed the name from the orginal Codeplex name while I was playing around with it). It could be called simply DetailsView1 or some such thing.)

3. In Source View (not Design View), in the upper left of the screen, click on the dropdown list and select the ID name you found in step 2 above.

4. Now, click on drop down list just to the right of the selected name and choose "Item Updating." This will add a new event handler to your source code (between the two script tags with the other stuff already there). This is how I got "Protected Sub dvEditMem_ItemUpdating ..." and "End Sub" statements. This event handler kicks off before the database is updated and after the user clicks "update."

5. Then, between these two lines of code, start typing "e." Intellisense will show you your choices (like NewValues, etc.). Just fill in the rest of the line of code to place something else besides "Null" or "nothing" in your variable name that you don't want the user to fill out, but that you want to use someplace else.

For instance, we want a membership end date because people pay for memberships for a certain amount of time. We don't want our users to upsdate that field, just officers. Because ClubStarter Kit won't update if there is a null value (which happens if it is not filled out by the user), my code puts in some date in the past so everyone is originally expired and then we update elsewhere.

Hope this works for you ... I struggled with it for a while ... and there may be better solutions because I am a true novice here. Any experts out there with a better solution?

Deborah