How to post data in MVC using form collection for Beginners.

Here we can simply put the data into the form tag and give each component an name .We are creating a login form using the MVC Architecture.

<form method="post" action="Name_of_the_function>
<input type="text" name=username id=username>
<input type="password" name =pass id=pass>
<input id=submit type="submit">

on controller
[httppost]
public ActionResult Name_of_the_function(formcollection form)
{
string str=form["username"];
string str1= form["pass"];
}

Comments

Popular posts from this blog

Initializing list and collection in c#.net

Power Apps Choice Column Default Value with connector as Sharepoint

RichTextBox Field in power apps as Sharepoint online defalut forms.