logo
  • 教程列表
  • SO官方文档
  • 模型绑定
    • 上传文件
    • 防止在 PostModel 上绑定
    • 路由值绑定
    • 查询字符串绑定
    • 绑定到对象
    • Ajax 绑定
    • 基于通用会话的模型绑定
    • 使用模型绑定器使用动态格式手动验证日期字段
  1. StackOverflow 文档
  2. asp.net-mvc 教程
  3. 模型绑定
  4. 查询字符串绑定

查询字符串绑定

Created: November-22, 2018

要扩展路由绑定,请说你有一个像 https://stackoverflow.com/questions/1558902?sort=desc 这样的网址

和 {controller=Home}/{action=Index}/{id?} 这样的路由

public ActionResult Index(int? id, string sort){
     //sort would bind to the value in the query string, i.e. "desc"
}
  • 绑定到对象
  • 路由值绑定

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明