<form name="mailform" id="mailform" method="post" action="@(ViewBag.Test)" class="testForm">
What I do is that this will give the action attribute as action=""(in case ViewBag.Test = null), but I am confused about the behavior of ASP.NET MVC.
If ViewBag.Test is not defined than my action attribute, this is not rendering. To confirm, I open the View-source in Chrome and Firefox, and none of them have an action attribute for my form. I also check this by modifying the text, but the action attribute remains not rendering.
Can someone explain what it is? And the link I can check is the general behavior of ASP.NET MVC 5
source
share