简体   繁体   中英

How to get other parameter's bound model in ModelBinder?

My controller's action accepts two parameters, each having a custom ModelBinder :

public ActionResult MyAction(
    [ModelBinder(typeof(FooBinder))] Foo foo,
    [ModelBinder(typeof(BarBinder))] Bar bar)

Is there a way to access the foo instance in the BarBinder ?

我不得不求助于其中一个合作使用感知模式FooBinder分享其foo例如BarBinder通过controllerContext.Controller.TempData字典。

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