I want to call a method from view written in the controller using image tags in the Asp.net mvc project. What should I do?
Below is my HTML code written in View:
@using (Html.BeginForm("LoginSuccess", "Login", FormMethod.Post))
{
@Html.AntiForgeryToken()
<form>
<p><img src="/Login/ShowCaptchaImage" /></p>
<p>Please enter the string as shown above:</p>
<p>@Html.TextBox("CaptchaText")</p>
<strong>@ViewBag.Message</strong>
</form>
}
I want to call ShowCaptchaImage() method on login page load.