Server Error in '/' Application.

Nullable object must have a value.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Nullable object must have a value.

Source Error:


Line 140:            imgImageUrl.Visible = entity.ShowImageUrl;
Line 141:            if (entity.Author.isNOE())
Line 142:                litPublishedDate.Text = (entity.HashAlarm) ? string.Format("<i class='fa fa-clock-o' aria-hidden='true'></i> {0:dddd, dd/MM/yyyy} {0:t}", entity.PublishedAlarm.Value) : string.Format("<i class='fa fa-clock-o' aria-hidden='true'></i> {0:dddd, dd/MM/yyyy} {0:t}", entity.PublishedDate.Value);
Line 143:            else
Line 144:                litPublishedDate.Text = (entity.HashAlarm) ? string.Format("<span class='author'>{0}</span> - <i class='fa fa-clock-o' aria-hidden='true'></i> {1:dddd, dd/MM/yyyy} {1:t}", entity.Author, entity.PublishedAlarm.Value) : string.Format("<span class='author'>{0}</span> - <i class='fa fa-clock-o' aria-hidden='true'></i> {1:dddd, dd/MM/yyyy} {1:t}", entity.Author, entity.PublishedDate.Value);

Source File: c:\Hosting\vietnet24h.vn\Views\FontEnd\News\View.ascx.cs    Line: 142

Stack Trace:


[InvalidOperationException: Nullable object must have a value.]
   System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) +56
   System.Nullable`1.get_Value() +23
   vietnet24h.WebUI.Views_FontEnd_News_View.OnBindData(News entity) in c:\Hosting\vietnet24h.vn\Views\FontEnd\News\View.ascx.cs:142
   Xrow.Web.UI.ViewXPart`1.BindData() +502
   Xrow.Web.UI.ViewXPart`1.OnXLoad() +128
   Xrow.Web.UI.XPart.XPart_Load(Object sender, EventArgs e) +759
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3282.0