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});
}