简体   繁体   中英

How to pass DateTime to Controller action

How do I pass a DateTime from javascript to my controller action?

I get a Jsonresult with a DateTime in it for displaying a list of x number of items. Now I want to pass in the last DateTime to get the next number of x items. How do I give the DateTime to correct way? Should I format it someway?

如果您的控制器接受DateTime类型,则只要您以.NET可以使用其ModelBinder(即DateTime.Parse )对其进行转换的方式发布它,它就可以正常工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM