真的我的问题很简单,但我不知道如何解决它。
我有ActionResult
方法,返回View
并获取datetime
属性,因此我在datetime
中发送ActionLink
属性
@Html.ActionLink("ForignSell", "ForignSell", "Reports", new {Start =@ImpDate.DateConfig},null)
ImpDate.DateConfig
是我在本地模式下运行时发送到Action
的日期datetime
以此格式绑定dd/MM/YYY
直到现在问题都没有问题当我在 IIS 中发布datetime
这个格式为MM/DD/YYY
的{{1}}时出现问题,这对我来说有问题,任何人都可以知道为什么它以不同方式绑定了吗?
答案 0 :(得分:0)
将日期对象转换为您想要的字符串格式:
@Html.ActionLink("ForignSell", "ForignSell", "Reports", new {Start = @ImpDate.DateConfig.ToString("dd/MM/yyy")}, null)
ActionLink助手将自动对路径数据进行url编码。