Avatar of Murray Brown
Murray Brown
Flag 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?




ASP.NETC#

Avatar of undefined
Last Comment
Chinmay Patel

8/22/2022 - Mon
Misha

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
Dorababu M

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
Chinmay Patel

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck