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.
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
Post a Comment