Hi florenz,
I have created sample code which full-fill your requirement.
HomeController
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult GetUserName(Users user)
{
string UserName = (user.EmailId).Split('@')[0]; // you are get here username.
return View();
}
}
View
<div>
<%using (Html.BeginForm("GetUserName", "Home", FormMethod.Post))
{ %>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
UserName:
<input type="text" name="EmailId" />
</td>
<td>
</td>
<td>
<input type="submit" name="Get UserName" value="Submit" />
</td>
</tr>
</table>
<%} %>
</div>
Model
public class User
{
public string EmailId { get; set; }
}