Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7009687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:53:38+00:00 2026-05-27T21:53:38+00:00

I am creating a loginform like this: @using (Ajax.BeginForm(Login, new AjaxOptions() { HttpMethod =

  • 0

I am creating a loginform like this:

@using (Ajax.BeginForm("Login", new AjaxOptions()
{
    HttpMethod = "POST",
    OnComplete = "onComplete"
}))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <div class="editor-label">
            @Html.LabelFor(model => model.Username, "Username")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Username)
            @Html.ValidationMessageFor(model => model.Username)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Password, "Wachtwoord")
        </div>
        <div class="editor-field">
            @Html.PasswordFor(model => model.Password)
            @Html.ValidationMessageFor(model => model.Password)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Remember, "Remember me")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Remember)
            @Html.ValidationMessageFor(model => model.Remember)
        </div>
        <p>
            <input type="submit" value="Inloggen" />
        </p>
    </fieldset>
}

Now the password is send unhashed over the internet for validation to the model, which is not safe. I want to make sure the password is always hashed going over the line and preventing man in the middle sniffers.

The onBegin won’t work because the elements cannot be modified anymore after this, any other ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:53:38+00:00Added an answer on May 27, 2026 at 9:53 pm

    You can do it without ajax by catching the submit event and hash the password before posting the form

     @using (Html.BeginForm("LogOn","Login",FormMethod.Post,new {id = "loginForm"})) {
        <div>
            <fieldset>
                <legend>Account information</legend>
    
                <div class="editor-label">
                    @Html.LabelFor(m => m.UserName)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.UserName)
                    @Html.ValidationMessageFor(m => m.UserName)
                </div>
    
                <div class="editor-label">
                    @Html.LabelFor(m => m.Password)
                </div>
                <div class="editor-field">
                    @Html.PasswordFor(m => m.Password, new {id = "password"})
                    @Html.ValidationMessageFor(m => m.Password)
                </div>
    
                <div class="editor-label">
                    @Html.CheckBoxFor(m => m.RememberMe)
                    @Html.LabelFor(m => m.RememberMe)
                </div>
    
                <p>
                    <input type="submit" value="Connect"  id="submit"/>
                </p>
            </fieldset>
        </div>}
    

    For example with this javascript code :

          $(function () {
              $("#loginForm").on("submit",function (e) {
    
                  var form = $(this);
                  var pass = $("#password").val();
                  $("#password").val(MD5(token + MD5(pass)));
    
                  form.submit();
              });
    
          });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm kind of new in here. I'm creating a login page in HTML with
i m creating a login system in codeigniter. i m new in codeigniter. i
I have creating a login form where I have created sqlite database,in this I
I have been creating user login form using the various groupcodes, the user login
I am creating one html login form and sending requests to login.php file. Now
I'm currently creating a Login form and have this code: string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
I'm creating login form using JSF 2.0. Below is the detailed description. When I
I'm creating a login form for vb.net using ms access 2003 as database. But
Hi I'm creating a login form from scratch in c# using 3 tiers. I've
I'm creating a composite widget using UiBinder. The widget is a login form, so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.