Products

Solutions

Learn More

Partners

Community

Blog

About

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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Custom Update Profile ModuleCustom Update Profile Module
Previous
 
Next
New Post
4/24/2013 8:27 AM
 

Hi,

I created  a customUpdate profile  module.In dnn i create a page and put my module in that page.But  if  logout   from my Custom Update Profile Page

 

i am getting the below exception.

System.ArgumentNullException: Value cannot be null. Parameter name: username at System.Web.Util.SecUtility.CheckParameter(String& param, Boolean checkForNull, Boolean checkIfEmpty, Boolean checkForCommas, Int32 maxSize, String paramName) at System.Web.Security.Membership.GetUser(String username, Boolean userIsOnline) at Christoc.Modules.FFEUpdateProfile.View.LoadControls() at Christoc.Modules.FFEUpdateProfile.View.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---

I am using the below code to update Passwords.


UserInfo userinfo1 = UserController.GetCurrentUserInfo();
          
            UserName = userinfo1.Username;

            DotNetNuke.Entities.Users.UserInfo userInfo = DotNetNuke.Entities.Users.UserController.GetUserByName(PortalId, UserName);
            DotNetNuke.Security.Membership.MembershipProvider membershipProvider = DotNetNuke.Security.Membership.MembershipProvider.Instance();
            bool pwdChanged = DotNetNuke.Entities.Users.UserController.ChangePassword(userInfo, oldPassword, new1.Value);


Please give s solution for this issue


Regards,

Nagasekhar.K

 

 
New Post
4/24/2013 9:38 AM
 
I guess the module uses information from the currently logged in user, and when you logout, it can't retrieve this data.

You can set the page/module permissions that only "Registered Users" can see the page/module. But a better way would be to do something like

try
{
// Get the information and assign the values to your form etc.
}
catch
{
// Hide the module container or write some kind of message
}

Best wishes
Michal

Michael Tobisch
DNN★MVP
helferlein.com - Michael Tobisch's Site about DNN, SQL Server, ASP.Net and other related stuff dnn-Connect.org - The most vibrant community around the DNN-platform
 
New Post
4/24/2013 10:51 AM
 

Hi Michal.

Thanks for replying I tried this but still i am getting same exception.

 

Thanks,

Nagasekhar.K

 

 

 
New Post
4/25/2013 2:32 AM
 
Nagasekhar,

look at the line:

DotNetNuke.Entities.Users.UserController.GetUserByName(PortalId, UserName);

UserName is NULL, when there is no user logged in, therefore you get the exception - or maybe earlier, when you request UserController.GetCurrentUserInfo().

Again: put the whole code in a try - catch construct, and display some message from the "catch" part.

Best wishes
Michael

Michael Tobisch
DNN★MVP
helferlein.com - Michael Tobisch's Site about DNN, SQL Server, ASP.Net and other related stuff dnn-Connect.org - The most vibrant community around the DNN-platform
 
New Post
4/25/2013 3:17 AM
 
Hi,

Better check whether user is logged in or not by using code HttpContext.Current.User.Identity.IsAuthenticated. Let the control to flow to the UserController.GetCurrentUserInfo(); part only when the value returned is true.

Thanks,
Avinash Kumar
Mindfire Solutions,India
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Custom Update Profile ModuleCustom Update Profile Module


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.
DNN Launch Webinar
REGISTER NOW
DNN Launch Webinar
REGISTER NOW
DNN Launch Webinar
REGISTER NOW