asp.net mvc - How do I bind a model automatically in background without change action parameter? -


i have coded model binder return simple model. want bind model every controllers without change controller action parameters. there anyway it?

thanks!

a model binder associated given type. in application_start:

modelbinders.binders.add(typeof(someviewmodel), new somemodelbinder()); 

this register somemodelbinder model binder controller actions take someviewmodel parameter. example:

public actionresult foo(someviewmodel model) {     ... } 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -