Re: formating text in a textbox control?
From: Curt_C [MVP] (software_AT_darkfalz.com)
Date: 12/10/04
- Next message: bruce barker: "Re: Asynchronous WebService Callback to Force Postback"
- Previous message: Mark Broadbent: "HTML over .net controls"
- In reply to: djc: "formating text in a textbox control?"
- Next in thread: djc: "Re: formating text in a textbox control?"
- Reply: djc: "Re: formating text in a textbox control?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 10 Dec 2004 14:47:21 -0600
Do a null check around it.
if(drMain.Item("EstimatedDeliveryDate") != null)
{
txtETA.Text = drMain.Item("EstimatedDeliveryDate").ToShortDateString() ;
}
else
{
txtETA.Text = "";
}
-- Curt Christianson Owner/Lead Developer, DF-Software Site: http://www.Darkfalz.com Blog: http://blog.Darkfalz.com "djc" <noone@nowhere.com> wrote in message news:OjTvGbv3EHA.4008@TK2MSFTNGP15.phx.gbl... > Is there a property or method of the textbox web server control that I can > use to format the text in it a certian way. For example I am displaying a > date value from a database in a text box. It displays like so: mm/dd/yyyy > mm:hh:ss. I 'was' using the .ToShortDateString() function like so: > txtETA.Text = drMain.Item("EstimatedDeliveryDate").ToShortDateString() > which > worked great until I came across a database record with NULL for this > field. > It seems the best thing to do would be to have something attatched to the > textbox control itself that would control formating of it's own contents. > That way I would not need to add a NULL check before using the > .ToShortDateString() function. > > any input would be appreciated. Thanks! > >
- Next message: bruce barker: "Re: Asynchronous WebService Callback to Force Postback"
- Previous message: Mark Broadbent: "HTML over .net controls"
- In reply to: djc: "formating text in a textbox control?"
- Next in thread: djc: "Re: formating text in a textbox control?"
- Reply: djc: "Re: formating text in a textbox control?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|