c# - Named arguments in BeginForm overload of MVC 4 -


i see overload beginform method has following signature:

(extension) mvcform htmlhelper.beginform(string actionname, string controllername, formmethod method)

and use named-arguments while invocation like,

@using (html.beginform(actionname:"index", controllername:"home", formmethod.get)) 

but, keep getting error this:

cs1738: named argument specifications must appear after fixed arguments have been specified 

any ideas going wrong ?

thanks.

you need specify parameter name last argument too:

@using (html.beginform(actionname:"index", controllername:"home", method:formmethod.get)) //                                                                  ↖ parameter name 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -