|
Subject:
|
Problem converting string to Date.
|
|
Posted By:
|
akhilhp
|
Post Date:
|
7/2/2008 12:21:35 AM
|
Hi,
I have developed a web project in asp.net 2.0, (VB). The project when run through VS 2005 was working very fine. But when I actually deployed the project (on the same machine where I developed it) it is giving problems. The problem is:
I am using Textbox to accept date. The date is being entered in dd/MM/yyyy format. I also use compare validator to compare the date to some other dates or the system date (whereever whichever required). Now while every thing was working fine before deployment, it is not giving desired results after deployment. After exmining it I have found out that while comparing it is converting date in (MM/dd/yyyy) format. My system's regional settings have date in dd/MM/yyyy format. Even when I use Cdate() function, it works fine through VS 2005 i.e. accets strings in dd/MM/yyyy format and converts them to dd/MM/yyyy format dates but after deployment it does not accept strings with dd/MM/yyyy format (e.g. when I enter date 13/07/2008 it gives error). Whereas I have learned that cdate accpts the local settings which is dd/MM/yyyy. Kindly somebody help me out. My project has been accepted and after successfull demo I am stuck after deployment....
|
|
Reply By:
|
akhilhp
|
Reply Date:
|
7/2/2008 2:09:57 AM
|
I was using Session.LCID = 2057 in Sub Session_Start in Global.asax and it was not working. Now I have Used session.LCID = 2057 on evry page in my project. It is working now. But can anybody suggest some better method (rather than using on every page)
|
|
Reply By:
|
pons_saravanan
|
Reply Date:
|
7/6/2008 8:02:21 AM
|
you may inherit all the pages from your custom class which inherits from system.web.ui.page. then you can do what ever you wish to do you can do it in this custom page. that will reflect in all pages
Pon Saravanan http://www.vbknowledgebase.com
|