-1

I created a simple login page in .net core C# with a model like so:


        public string UserEmail { get; set; }

        public string UserPassword { get; set; }

and i set it on my razor page like so:

<input type="email" id="email-user" class="form-control mb-4" asp-for="UserEmail" placeholder="E-mail">

<input type="password" id="password-user" class="form-control mb-4" asp-for="UserPassword" placeholder="Password">

after user clicks a button, he goes to next page but the url contains his email and password like so:

https://localhost:44306/User/Welcome?UserEmail=sampleemail%40gmail.com&UserPassword=dasdasdsa

1 Answers1

0

I believe you are using a GET request where you would want to use a POST request.

During a GET request, parameters can be sent throw the URL.
In a POST request, you can send your parameters throw the body of the request.

Please consult what-is-the-difference-between-post-and-get and this doc to get more details on HTTP protocol.

Skrface
  • 1,246
  • 1
  • 8
  • 17
  • hmm I am not using GET or POST it's just a simple website with Action Success (that returns a page with a simple hi message) – Hubert Mijalski May 26 '19 at 16:10
  • @HubertMijalski From your frontend, your form is sent throw the URL because your request is a GET. That's why you have those parameters in the URL.. Look at the
    tag in your frontend, around your s. Is it set to send throw GET or POST ?
    – Skrface May 26 '19 at 16:13