Pass a datetime from javascript to c# (Controller)

前端 未结 7 2229
小蘑菇
小蘑菇 2020-12-08 02:01

How do you pass a date time (i need it to the second) to c# using jquery and mvc3. This is what I have

var date = new Date();    
$.ajax(
   {
       type: \         


        
7条回答
  •  余生分开走
    2020-12-08 02:21

    I found that I needed to wrap my datetime string like this:

    "startdate": "\/Date(" + date() + ")\/"
    

    Took me an hour to figure out how to enable the WCF service to give me back the error message which told me that XD

提交回复
热议问题