lambda - ASP.NET BeginForm() expression syntax -


I would like to use expression based syntax for HTML of ASP.NET MVC. Begengform (for example, HTMLbizoform & lt; HomeControler & gt; (A => a.ActionForSubmit ();) This gives you the increasing testability.

What I'm not clear about doing For example, I have a login operation. It is only HTTP POST and has two parameters: Username and Password.

If I use Expression-based syntax , So i ended up with html BeginForm & lt; MyAccountController & gt; (a => a.login (null null)); - pair (required according to the signature of the action) seems to be too much for me for the initial expression. Wrongfully?

If this action was to take a FormCollection example with this expression?

Thanks, Derek.

< P>

You can just pass string.Empty and when you post it, Will form.

I would not pass null. Whatever it is, it will accept whatever you believe in the first expression, and then overwrite something on that post. This is a best practice for me to use string. Spaces instead of spaces


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -