Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

ASP.net Razor page - C# code behind log in button

Hi

In ASP.net Core Razor pages like the one shown below where would I find the C# code in the click event when the "LOGIN" button is clicked?


User generated image

Avatar of Misha
Misha
Flag of Russian Federation image

Can you post your html code?
Try to find some code like this:
<button type="submit" 

Open in new window

or
 <input type="submit" value="Login" asp-page-handler="LoginHandler" />

Open in new window


LoginHandler method in your controller can handle button click event on server
Can you post the sample of your cshtml desgin. Ideally if you see like this
using (Html.BeginForm("ActioName", "ControllerName", FormMethod.Post))
{
}

Open in new window

Then your code will be in respective controller, in your example it might be in AccountController check for post method and see
ASKER CERTIFIED SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial