G
Guest
I'm having a problem with dates.
(No not the sort that you have at christmas)
I have a webform with a text box and a calendar control.
You can either
- enter a date manually (we are talking uk style here dd/mm/yyyy) in the
textbox
- click a date on the calendar which puts the date value in the textbox (uk
style)
pointing a browser at my machine this works fine
pointing at the UAT and production machines it falls in a heap with the
error shown below
I've asked our admin to check and he says everything is configured to be uk
where possible
This is for an intranet app so i'm not bothered about time zones and all
that crap.
i've seen a bunch of postings where people are using
datetime.parse(xx,formatprovider) with all sorts of bits and pieces
and some of the formatting things are crazy
5 or 6 lines of code just to format something from a text box
i thought asp.net was supposed to make you more productive with fewer lines
of code!
why am i getting the error?
is there any file on the servers in question i can change to make it work?
also
all of the other date values on the screen (when using the other servers)
are shown using US date format
can anyone shed any light on this?
thanks!
ERROR START-----
Server Error in '/inDus' Application.
--------------------------------------------------------------------------------
String was not recognized as a valid DateTime.
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.FormatException: String was not recognized as a
valid DateTime.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[FormatException: String was not recognized as a valid DateTime.]
inDus.Data.Release.CreateNewRelease(String Description, String
ReleaseDate, Int32 ProjectID)
inDus.Releases.AddRelease.CmdCreateRelease_Click(Object sender, EventArgs
e)
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
(No not the sort that you have at christmas)
I have a webform with a text box and a calendar control.
You can either
- enter a date manually (we are talking uk style here dd/mm/yyyy) in the
textbox
- click a date on the calendar which puts the date value in the textbox (uk
style)
pointing a browser at my machine this works fine
pointing at the UAT and production machines it falls in a heap with the
error shown below
I've asked our admin to check and he says everything is configured to be uk
where possible
This is for an intranet app so i'm not bothered about time zones and all
that crap.
i've seen a bunch of postings where people are using
datetime.parse(xx,formatprovider) with all sorts of bits and pieces
and some of the formatting things are crazy
5 or 6 lines of code just to format something from a text box
i thought asp.net was supposed to make you more productive with fewer lines
of code!
why am i getting the error?
is there any file on the servers in question i can change to make it work?
also
all of the other date values on the screen (when using the other servers)
are shown using US date format
can anyone shed any light on this?
thanks!
ERROR START-----
Server Error in '/inDus' Application.
--------------------------------------------------------------------------------
String was not recognized as a valid DateTime.
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.FormatException: String was not recognized as a
valid DateTime.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[FormatException: String was not recognized as a valid DateTime.]
inDus.Data.Release.CreateNewRelease(String Description, String
ReleaseDate, Int32 ProjectID)
inDus.Releases.AddRelease.CmdCreateRelease_Click(Object sender, EventArgs
e)
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292