Answers for "jquery save method"

0

jquery save method

<script type="text/javascript">
        $(document).ready(function () {
            $("#Button1").click(function () {
                $.ajax({
                    type: 'POST',
                    contentType: "application/json;charset=utf-8",
                    url: 'Default2.aspx/InsertMethod',
                    data: "{'username':'" + document.getElementById('txtusername').value + "','password':'" + document.getElementById("txtpassword").value + "'}",
                    async: false,
                    success: function (response) {
                        $('#txtusername').val('');
                        $('#txtpassword').val('');
                        alert("record has been saved in database");

                    },
                    error: function () {
                    console.log('there is some error');
                    }

                });

            });

        });
Posted by: Guest on October-11-2020
0

jquery save method

SqlCommand cmd = new SqlCommand("insert jquerydata values('" + username + "','" + password + "'", con);
Posted by: Guest on October-11-2020
0

jquery save method

dfsagdfgdsf
Posted by: Guest on September-09-2021
0

jquery save method

[WebMethod]
    public static string InsertMethod(string username, string password)
    {
        SqlConnection con = new SqlConnection();
        con.ConnectionString = ConfigurationManager.ConnectionStrings["con"].ConnectionString;
        con.Open();
        SqlCommand cmd = new SqlCommand("insert jquerydata values('" + username + "','" + password + "'", con);
        cmd.CommandType = CommandType.Text;
        cmd.ExecuteNonQuery();
        cmd.Dispose();
        con.Close();
        return "true";

    }
Posted by: Guest on October-11-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language