Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedCannot insert custom code into Cannot insert custom code into
Previous
 
Next
New Post
5/20/2010 9:32 AM
 
Good morning,
I am developing with DNN 05.03.xx.

I have created a custom implementation of Profile provider and put business logic inside it. When users store wrong data in their profiles I raise exceptions. Everything works fine. The only problem I have - the exception messages are not displayed on the form. I believe I know why. This is the code from Profile.ascx.vb:

Private Sub cmdUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdUpdate.Click
            If IsValid Then
                Dim properties As ProfilePropertyDefinitionCollection = CType(ProfileProperties.DataSource, ProfilePropertyDefinitionCollection)

                'Update User's profile
                User = ProfileController.UpdateUserProfile(User, properties)
                OnProfileUpdated(EventArgs.Empty)
                OnProfileUpdateCompleted(EventArgs.Empty)
            End If

Exceptions are not handled here.

Once I surrounded this line:

ProfileController.UpdateUserProfile(User, properties)

with my error handling code, Profile user control stopped loading at all. It looks like Profile.ascx.vb cannot be changed. Or, maybe I am doing something wrong?

Thank you.
 
New Post
5/20/2010 11:48 AM
 
Sorry, I was wrong. The code-behind file can be changed and everything works fine.
The problem I am facing is displaying the text of the error.  This my code:

Private Sub cmdUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdUpdate.Click
 If IsValid Then
                Dim properties As ProfilePropertyDefinitionCollection = CType(ProfileProperties.DataSource, ProfilePropertyDefinitionCollection)

                'Update User's profile
    Try               
        User = ProfileController.UpdateUserProfile(User, properties)
        OnProfileUpdated(EventArgs.Empty)
                   OnProfileUpdateCompleted(EventArgs.Empty)
    Catch ex as Exception
        Me.AddLocalizedModuleMessage(ex.Message, ModuleMessageType.RedError, True)
        'UI.Skins.Skin.AddModuleMessage(Me, ex.Message, ModuleMessageType.RedError)
    End Try 
            End If

        End Sub


Neither Me.AddLocalizedModuleMessage nor UI.Skins.Skin.AddModuleMessage helps.
Could you please help with this?

Thanks.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedCannot insert custom code into Cannot insert custom code into


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out