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 StartedError on sending Notification Error on sending Notification
Previous
 
Next
New Post
8/26/2014 4:59 AM
 

AssemblyVersion:7.3.1

PortalID:0

PortalName:My Website

UserID:1

UserName:ckloong

ActiveTabID:88

ActiveTabName:Calendar Booking

RawURL:/Calendar-Booking/ctl/AddEvent/mid/416?popUp=true&start=2014/7/31&end=2014/7/31

AbsoluteURL:/Default.aspx

AbsoluteURLReferrer:http://dnndev.me/Calendar-Booking/ctl/AddEvent/mid/416?popUp=true&start=2014/7/31&end=2014/7/31

UserAgent:Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke

ExceptionGUID:db9de8d7-d5d0-493c-8d6d-1551e9ddffcb

InnerException:Object reference not set to an instance of an object.

FileName:

FileLineNumber:0

FileColumnNumber:0

Method:DotNetNuke.Services.Social.Notifications.NotificationsController.<SendNotification>b__8

StackTrace:

Message:

DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at DotNetNuke.Services.Social.Notifications.NotificationsController.<SendNotification>b__8(UserInfo user)
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at DotNetNuke.Services.Social.Notifications.NotificationsController.SendNotification(Notification notification, Int32 portalId, IList`1 roles, IList`1 users)
   at Tverve.AddEvent.btntest_Click(Object sender, EventArgs e) in d:\DotNetNuke\DesktopModules\FullCalendar\AddEvent.ascx.cs:line 81
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   --- End of inner exception stack trace ---

 

Source:

 

 

i cant understand why my Notification will have this error, when i apply on a button. did i do anything wrong ? im still new for DNN.

 

protected void btntest_Click(object sender, EventArgs e)

        {

            

            var notificationType = NotificationsController.Instance.GetNotificationType("HtmlNotification");

            var portalSettings = PortalController.Instance.GetCurrentPortalSettings();

            var sennder = UserController.GetUserById(portalSettings.PortalId, portalSettings.AdministratorId);

            var notification = new Notification { NotificationTypeID = notificationType.NotificationTypeId, Subject = subject, Body = body, IncludeDismissAction = true, SenderUserID = sennder.UserID, To= Convert.ToString(UserInfo.UserID)};

            NotificationsController.Instance.SendNotification(notification, PortalSettings.PortalId, null, new List<UserInfo>{user});

       

        }

 

 
New Post
9/4/2014 7:40 AM
 
hard to say without all the code as it could be a number of null (or uninitialized objects) e.g. if you dont have a notification type of HtmlNotification -you'll just have to debug through the code to determine the failing value

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedError on sending Notification Error on sending Notification


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