C# mvc4 Redirect相关问题

.Net技术 码拜 9年前 (2015-11-12) 1029次浏览
代码:

 [RouteArea("TrafficFines")]
    public class TrafficFinesController : BaseController
    {
.................................
        [GET("PayView/{orderID}/{orderTime}/{totalFee}")]
        public ActionResult PayView(string orderID, string orderTime, decimal totalFee)
        {
            PayInfo pm = new PayInfo
            {
                orderID = Request.get("orderID"),
                orderTime = Convert.ToDateTime(Request.get("orderTime")),
                totalFee = Request.getDecimal("totalFee"),
                openID = base.UUID,
                partnerID = BaseConfig.Instance.API_partnerID(),
                sign = BaseConfig.Instance.API_sign()
            };
            return View(pm);
        }
..........................
 PayInfo pm = new PayInfo
            {
                orderID = fillOrderResponse.Ordersn,
                orderTime = DateTime.Now,
                totalFee = fillOrderResponse.Ordercharge * 10 * 10,
                openID = base.UUID,
                partnerID = BaseConfig.Instance.API_partnerID(),
                sign = BaseConfig.Instance.API_sign()
            };
            return Redirect("/TrafficFines/PayView?orderID=" + fillOrderResponse.Ordersn + "&orderTime=" + DateTime.Now + "&totalFee=" + fillOrderResponse.Ordercharge * 10 * 10);
....

Redirect跳转找不到页面404,
没有分了….

解决方案:20分
PayView/{orderID}/{orderTime}/{totalFee} 这个在Url的路径里。
Redirect(“/TrafficFines/PayView?orderID=” + … 这个在Url的Query参数里。

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明C# mvc4 Redirect相关问题
喜欢 (0)
[1034331897@qq.com]
分享 (0)