Solved

ASP.NET 3.5 | Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.

Posted on 2014-03-12
12
364 Views
Last Modified: 2014-03-22
Hi experts,

Suddenly and with no any changes on my project, except changing some fonts in the CSS file, I started getting this error:
---------------------------------------------------------------------------------------------------------------
Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.
---------------------------------------------------------------------------------------------------------------
The error appears with no any references to a page or a line of code when I try building my project. However, if I try publishing the project it shows me the error on almost all the pages and points to a line where I have referenced a user control on all my pages:
---------------------------------------------------------------------------------------------------------------
<%@ Register Src="../../DesktopModuleTitle.ascx" TagName="DesktopModuleTitle" TagPrefix="uc1" %>
---------------------------------------------------------------------------------------------------------------
This ascx registration is repeated inside all of my aspx files, and it shows the error on all of these!
What went wrong, and how do I get rid of this error?
0
Comment
Question by:feesu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 2
12 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39923284
there must be a change, presumably in that usercontrol.
check the constructor and class properties of it, so each datetime typed value is properly initialized.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39923377
I haven't dealt with this issue myself, but according to this:

http://runtingsproper.blogspot.com/2010/03/solved-error-1-ticks-must-be-between.html

...the issue might be with one of your static content files (e.g. an image file). You might want to check the timestamps of your content files to see if they suffer something similar to the missing dates outlined in the linked article.
0
 

Author Comment

by:feesu
ID: 39925678
a3,

I confirm I haven't changed anything except for some CSS content.

The user control's markup is very simple:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="DesktopModuleTitle.ascx.vb" Inherits="DesktopModuleTitle" %>

<table id="tbl_0_container" runat="server" cellpadding="1" cellspacing="0" 
    width="100%" border="0" bordercolor="Blue">
    <tr>
        <td id="td_container_title" class="module_Title" runat="server">
            <table id="tbl_Title" runat="server" cellpadding="0" cellspacing="0" border="0" 
                bordercolor="Red" >
                <tr>
                    <td id="td_titleImage" runat="server" align="<%$ Resources:Resource, LeftAligned %>">
                        <asp:Image ID="img_ModuleTitleImage" runat="server"  />
                    </td>
                    <td runat="server" align="<%$ Resources:Resource, LeftAligned %>" id="td_title">
                        <asp:Label ID="lbl_ModuleTitle" runat="server" EnableViewState="False"></asp:Label>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td id="td_container_subTitle" class="module_subTitle" runat="server">
            <table id="tbl_subTitle" runat="server" cellpadding="0" cellspacing="0" 
                border="0" bordercolor="Red" >
                <tr>
                    <td runat="server" align="<%$ Resources:Resource, LeftAligned %>">
                        <asp:Label 
                                ID="lbl_ModuleSubTitle" 
                                runat="server" 
                                EnableViewState="False">
                        </asp:Label>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>

<asp:TextBox ID="txt_AlternativeClass" runat="server" BackColor="#CC0000" Visible="False" Width="10px"></asp:TextBox> 

Open in new window



Kaufmed,

I had seen that article, where the user had a jpg issue. Mine does not apply there.
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39925711
can we please see the code behind (DesktopModuleTitle.ascx.vb), the issue shall be in there, or in the control designer code ...
0
 

Author Comment

by:feesu
ID: 39925954
Here you go:

Partial Class DesktopModuleTitle
    Inherits System.Web.UI.UserControl

#Region "Properties"
    Private _ModuleTitle As String
    Public Property ModuleTitle() As String
        Get
            Return _ModuleTitle
        End Get
        Set(ByVal Value As String)
            _ModuleTitle = Value
            OnPropertyChanged_ModuleTitle(New ComponentModel.PropertyChangedEventArgs("moduletitle"))
        End Set
    End Property
    Private Sub OnPropertyChanged_ModuleTitle(ByVal propertyChangedEventArgs As ComponentModel.PropertyChangedEventArgs)
        Me.lbl_ModuleTitle.Text = Me.ModuleTitle
        td_container_title.Visible = CBool(lbl_ModuleTitle.Text.Trim <> "")
    End Sub

    Private _ModuleSubTitle As String
    Public Property ModuleSubTitle() As String
        Get
            Return _ModuleSubTitle
        End Get
        Set(ByVal Value As String)
            _ModuleSubTitle = Value
            OnPropertyChanged_ModuleSubTitle(New ComponentModel.PropertyChangedEventArgs("ModuleSubTitle"))
        End Set
    End Property
    Private Sub OnPropertyChanged_ModuleSubTitle(ByVal propertyChangedEventArgs As ComponentModel.PropertyChangedEventArgs)
        Me.lbl_ModuleSubTitle.Text = Me.ModuleSubTitle
        td_container_subTitle.Visible = CBool(lbl_ModuleSubTitle.Text.Trim <> "")
    End Sub

    Private _AlternativeClass As Boolean
    Public Property AlternativeClass() As Boolean
        Get
            Return _AlternativeClass
        End Get
        Set(ByVal Value As Boolean)
            _AlternativeClass = Value
            OnPropertyChanged_AlternativeClass(New ComponentModel.PropertyChangedEventArgs("AlternativeClass"))
        End Set
    End Property
    Private Sub OnPropertyChanged_AlternativeClass(ByVal propertyChangedEventArgs As ComponentModel.PropertyChangedEventArgs)
        If Me.AlternativeClass = True Then
            Me.td_container_title.Attributes.Add("Class", "module_Title_alternative")
            Me.td_container_subTitle.Attributes.Add("Class", "module_subTitle_alternative")
        End If
    End Sub

#End Region

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ' Obtain PortalSettings from Current Context
        Dim _portalSettings As PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), PortalSettings)

        ' Obtain reference to parent portal module
        Dim portalModule As PortalModuleControl '20091212 to avoid below mentioned error
        If TypeOf (Me.Parent) Is UserControl Then
            portalModule = CType(Me.Parent, PortalModuleControl)

        ElseIf TypeOf (Me.Parent.Parent) Is UserControl Then
            portalModule = CType(Me.Parent.Parent, PortalModuleControl)

        ElseIf TypeOf (Me.Parent.Parent.Parent) Is UserControl Then
            portalModule = CType(Me.Parent.Parent.Parent, PortalModuleControl)

        ElseIf TypeOf (Me.Parent.Parent.Parent.Parent) Is UserControl Then
            portalModule = CType(Me.Parent.Parent.Parent.Parent, PortalModuleControl)

        ElseIf TypeOf (Me.Parent.Parent.Parent.Parent.Parent) Is UserControl Then
            portalModule = CType(Me.Parent.Parent.Parent.Parent.Parent, PortalModuleControl)

        ElseIf TypeOf (Me.Parent.Parent.Parent.Parent.Parent.Parent) Is UserControl Then
            portalModule = CType(Me.Parent.Parent.Parent.Parent.Parent.Parent, PortalModuleControl)

        ElseIf TypeOf (Me.Parent.Parent.Parent.Parent.Parent.Parent.Parent) Is UserControl Then
            portalModule = CType(Me.Parent.Parent.Parent.Parent.Parent.Parent.Parent, PortalModuleControl)

        End If
        'With Me.Parent
        '    If TypeOf (.Parent) Is System.Web.UI.HtmlControls.HtmlTableCell Then
        '        'portalModule = CType(Me.Parent, PortalModuleControl) 'NOTE: this created a runtime cast error after i changed the container table in the user control to run at server
        '        'Else
        '        portalModule = CType(Me.Parent.Parent.Parent.Parent.Parent, PortalModuleControl)
        '    Else
        '        portalModule = CType(Me.Parent.Parent.Parent.Parent, PortalModuleControl)
        '    End If
        'End With

        ' Display Modular Title Text and Edit Buttons

        If Not IsPostBack Then
            Dim sTitleImage As String = portalModule.ModuleConfiguration.ModuleTitleImage
            If sTitleImage.Trim = "" Then
                img_ModuleTitleImage.Visible = False
                td_titleImage.Visible = False
                'td_titleImage_partition.Visible = False
            Else
                img_ModuleTitleImage.ImageUrl = "~\files\" & sTitleImage
                td_titleImage.Visible = True
                'td_titleImage_partition.Visible = True
            End If

            '20100212
            'If Not IsPostBack Then
            '    If titleClass.Trim <> "" Then
            '        Me.txtTitleClass.Value = titleClass
            '    End If
            'End If


            'Me.pageTitle = Me.lblModuleTitle.Text
            'lblModuleTitle.Text = portalModule.ModuleConfiguration.ModuleTitle
            lbl_ModuleTitle.Text = portalModule.ModuleConfiguration.ModuleTitle
            lbl_ModuleSubTitle.Text = portalModule.ModuleConfiguration.ModuleSubTitle

            td_container_title.Visible = CBool(lbl_ModuleTitle.Text.Trim <> "" Or sTitleImage.Trim <> "")
            td_container_subTitle.Visible = CBool(lbl_ModuleSubTitle.Text.Trim <> "")

            'If PortalSecurity.IsInRoles(PortalSecurity.GetPermissionRoles(Module_IKey, Actions.Edit)) Then

            'End If
        End If

    End Sub
End Class

Open in new window

Partial Class DesktopModuleTitle
    Inherits System.Web.UI.UserControl

#Region "Properties"
    Private _ModuleTitle As String
    Public Property ModuleTitle() As String
        Get
            Return _ModuleTitle
        End Get
        Set(ByVal Value As String)
            _ModuleTitle = Value
            OnPropertyChanged_ModuleTitle(New ComponentModel.PropertyChangedEventArgs("moduletitle"))
        End Set
    End Property
    Private Sub OnPropertyChanged_ModuleTitle(ByVal propertyChangedEventArgs As ComponentModel.PropertyChangedEventArgs)
        Me.lbl_ModuleTitle.Text = Me.ModuleTitle
        td_container_title.Visible = CBool(lbl_ModuleTitle.Text.Trim <> "")
    End Sub

    Private _ModuleSubTitle As String
    Public Property ModuleSubTitle() As String
        Get
            Return _ModuleSubTitle
        End Get
        Set(ByVal Value As String)
            _ModuleSubTitle = Value
            OnPropertyChanged_ModuleSubTitle(New ComponentModel.PropertyChangedEventArgs("ModuleSubTitle"))
        End Set
    End Property
    Private Sub OnPropertyChanged_ModuleSubTitle(ByVal propertyChangedEventArgs As ComponentModel.PropertyChangedEventArgs)
        Me.lbl_ModuleSubTitle.Text = Me.ModuleSubTitle
        td_container_subTitle.Visible = CBool(lbl_ModuleSubTitle.Text.Trim <> "")
    End Sub

    Private _AlternativeClass As Boolean
    Public Property AlternativeClass() As Boolean
        Get
            Return _AlternativeClass
        End Get
        Set(ByVal Value As Boolean)
            _AlternativeClass = Value
            OnPropertyChanged_AlternativeClass(New ComponentModel.PropertyChangedEventArgs("AlternativeClass"))
        End Set
    End Property
    Private Sub OnPropertyChanged_AlternativeClass(ByVal propertyChangedEventArgs As ComponentModel.PropertyChangedEventArgs)
        If Me.AlternativeClass = True Then
            Me.td_container_title.Attributes.Add("Class", "module_Title_alternative")
            Me.td_container_subTitle.Attributes.Add("Class", "module_subTitle_alternative")
        End If
    End Sub

#End Region

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ' Obtain PortalSettings from Current Context
        Dim _portalSettings As PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), PortalSettings)

        ' Obtain reference to parent portal module
        Dim portalModule As PortalModuleControl '20091212 to avoid below mentioned error
        If TypeOf (Me.Parent) Is UserControl Then
            portalModule = CType(Me.Parent, PortalModuleControl)

        ElseIf TypeOf (Me.Parent.Parent) Is UserControl Then
            portalModule = CType(Me.Parent.Parent, PortalModuleControl)

        ElseIf TypeOf (Me.Parent.Parent.Parent) Is UserControl Then
            portalModule = CType(Me.Parent.Parent.Parent, PortalModuleControl)

        ElseIf TypeOf (Me.Parent.Parent.Parent.Parent) Is UserControl Then
            portalModule = CType(Me.Parent.Parent.Parent.Parent, PortalModuleControl)

        ElseIf TypeOf (Me.Parent.Parent.Parent.Parent.Parent) Is UserControl Then
            portalModule = CType(Me.Parent.Parent.Parent.Parent.Parent, PortalModuleControl)

        ElseIf TypeOf (Me.Parent.Parent.Parent.Parent.Parent.Parent) Is UserControl Then
            portalModule = CType(Me.Parent.Parent.Parent.Parent.Parent.Parent, PortalModuleControl)

        ElseIf TypeOf (Me.Parent.Parent.Parent.Parent.Parent.Parent.Parent) Is UserControl Then
            portalModule = CType(Me.Parent.Parent.Parent.Parent.Parent.Parent.Parent, PortalModuleControl)

        End If
        'With Me.Parent
        '    If TypeOf (.Parent) Is System.Web.UI.HtmlControls.HtmlTableCell Then
        '        'portalModule = CType(Me.Parent, PortalModuleControl) 'NOTE: this created a runtime cast error after i changed the container table in the user control to run at server
        '        'Else
        '        portalModule = CType(Me.Parent.Parent.Parent.Parent.Parent, PortalModuleControl)
        '    Else
        '        portalModule = CType(Me.Parent.Parent.Parent.Parent, PortalModuleControl)
        '    End If
        'End With

        ' Display Modular Title Text and Edit Buttons

        If Not IsPostBack Then
            Dim sTitleImage As String = portalModule.ModuleConfiguration.ModuleTitleImage
            If sTitleImage.Trim = "" Then
                img_ModuleTitleImage.Visible = False
                td_titleImage.Visible = False
                'td_titleImage_partition.Visible = False
            Else
                img_ModuleTitleImage.ImageUrl = "~\files\" & sTitleImage
                td_titleImage.Visible = True
                'td_titleImage_partition.Visible = True
            End If

            '20100212
            'If Not IsPostBack Then
            '    If titleClass.Trim <> "" Then
            '        Me.txtTitleClass.Value = titleClass
            '    End If
            'End If


            'Me.pageTitle = Me.lblModuleTitle.Text
            'lblModuleTitle.Text = portalModule.ModuleConfiguration.ModuleTitle
            lbl_ModuleTitle.Text = portalModule.ModuleConfiguration.ModuleTitle
            lbl_ModuleSubTitle.Text = portalModule.ModuleConfiguration.ModuleSubTitle

            td_container_title.Visible = CBool(lbl_ModuleTitle.Text.Trim <> "" Or sTitleImage.Trim <> "")
            td_container_subTitle.Visible = CBool(lbl_ModuleSubTitle.Text.Trim <> "")

            'If PortalSecurity.IsInRoles(PortalSecurity.GetPermissionRoles(Module_IKey, Actions.Edit)) Then

            'End If
        End If

    End Sub
End Class

Open in new window

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39926067
I must admit that I don't see what could be wrong there.
can you get the file before those changes, and see if you get still the same issue?
0
 

Author Comment

by:feesu
ID: 39926211
a3,

That's all I initially added when I got different errors to do with the format itself, but later started getting the current error. I have removed what I've added completely but still that error didin't go away:

/* Generated by Font Squirrel (http://www.fontsquirrel.com) on March 12, 2014 */



@font-face {
    font-family: 'source_sans_prolight';
    src: url('sourcesanspro-light-webfont.eot');
    src: url('sourcesanspro-light-webfont.eot?#iefix') format('embedded-opentype'),
         url('sourcesanspro-light-webfont.woff') format('woff'),
         url('sourcesanspro-light-webfont.ttf') format('truetype'),
         url('sourcesanspro-light-webfont.svg#source_sans_prolight') format('svg');
    font-weight: normal;
    font-style: normal;

}
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39926320
where the user had a jpg issue. Mine does not apply there.
I have removed what I've added completely but still that error didin't go away
What about those font and vector graphics files you are embedding?
0
 

Author Comment

by:feesu
ID: 39926660
I only added the previous lines to the CSS file and a folder holding the fonts. I removed the code of the CSS and deleted the folder.
0
 

Accepted Solution

by:
feesu earned 0 total points
ID: 39933853
Hi Experts,

All I did was that I excluded the CSS file, and re-included it, and the problem was gone!

This is so weird that I cannot justify.

Thanks,
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39933862
the wonders of "visual studio" sometimes getting weird ...
0
 

Author Closing Comment

by:feesu
ID: 39947236
This is what actually solved my problem. Although it does not have a proper justification.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question