Hi Everyone,This is very strange and as of yet I cant seem to get round it, although it is a somewhat easy error to identify it is however becoming very annoying as everything I try doesn't seem to work...The repeater displays results for upcoming subscribers birthdays and after their day and month ("dd/mm/") I have a label to display the current year. This causes the old error of:
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.Source Error:
Line 55: Label lblYear = e.Item.FindControl("lblYear") as Label;Line 56: Line 57: lblYear.Text = DateTime.Now.Year.ToString();Line 58: }Line 59:
As you can see the object is set correctly - The ASPX is below, for saving time on reading etc I've posted the repeater script only and not the whole page, although I can do if needs be.I've tried a number of things with subtle differences but to no avail: with Literal, same error - Tried inserting the year directly via <%#((system.datetime).now.year.tostring())%> or something to that effect, this also doesnt
View Complete Post