简体   繁体   中英

send form data to server or to backend , when backend is ASP.NET

Hi im new to frontend and i know only HTML, CSS and JS. so my friend and i are doing a project which is a user panel where a manger can add users to panel. my friend wants to code backend with ASP.NET. i have made a form which is used for adding user but i dont know how to send the form data to server or to backend.

 <form class="addUser-from" action="" method="Post"> <div class="form-row"> <div class="form-dow-box"> <label for="userName">username</label> <input type="text" name="userName" id="userName" placeholder="username" required="" oninvalid="this.setCustomValidity('لطفا نام و نام خانوادگی را وارد کنید')" oninput="this.setCustomValidity('')"/> </div> <div class="form-dow-box"> <label for="user-id-number">id number </label> <input type="text" name="user-id-number" id="user-id-number" placeholder="id number" required="" oninvalid="this.setCustomValidity('لطفا کد ملی را وارد کنید')" oninput="this.setCustomValidity('')"/> </div> </div> <div class="form-row"> <div class="form-dow-box"> <label for="userPass">password</label> <input type="password" name="userPass" id="userPass" placeholder="password" required="" oninvalid="this.setCustomValidity('لطفا رمز عبور را وارد کنید')" oninput="this.setCustomValidity('')"/> </div> </div> <div class="submit-box-btn"> <button type="submit" class="form-box-submit">add</button> </div> </form>

You would do this through the action tag in the HTML, you would have to give it the URL of the controller you are sending it to in ASP EG: "/user/add". Getting the data is backend from there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM