0 Replies - 812 Views - Last Post: 27 June 2017 - 06:05 AM Rate Topic: -----

#1 zapp1  Icon User is offline

  • D.I.C Head

Reputation: -3
  • View blog
  • Posts: 69
  • Joined: 07-December 16

How to enter datetime string to field of asp.net mvc view?

Posted 27 June 2017 - 06:05 AM

I enter such kind as 01.10.1999 12:00:00 or 01/10/1999 12:00:00 with (AM) or without and
when passing to controller Convertto.Datetime(Request["datefiled"]) and then again to view I got
01.01.0001 00:00:01??
How enter in html form field correct datetime -- maybe put T between date and time 01.10.1999T12:00:00?
Then I use DateTime.Parse(Request["datefiled"]) and get the exception of such kind:
String reference is not set to instance of string. String parameter s. But I put string value to input field?
Convertto.Double(Request["count"]) works well if in previous two examples I pass null??
In previous application I used the same datetime passing but passed just date -- 01.10.1999 or 01/10/1999
and it worked -- what do do here?

Is This A Good Question/Topic? 0
  • +

Page 1 of 1