error while inserting values into a table using jquery("NetworkError: 405 Method Not Allowed )
<p>I am using following jquery code in an aspx page:</p>

<pre><code>&lt;%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %&gt;

&lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt;
    &lt;script type="text/javascript"&gt;
        $(document).ready(function () 
         {
            $("#&lt;%= Button1.ClientID %&gt;").click(function () {
                var UserName = $('#&lt;%=TextBox1.ClientID%&gt;').val();
                var Phone = $('#&lt;%=TextBox3.ClientID%&gt;').val();
                var Email = $('#&lt;%=TextBox2.ClientID%&gt;').val();
                var Message = $('#&lt;%=TextBox4.ClientID%&gt;').val();
                var json = "{'" + UserName + "','" + Phone + "','" + Email + "''"            +Message + "'}";

                $.ajax({
                    type: "POST",
                    //C:\Users\hp\Documents\Visual Studio 2010\WebSites\
                    //C:/Users/hp/Documents/Visual Studio 2010/WebSites/jQuerySubmitForm/
                    url: "/jQuerySubmitForm/JqueryFunction/insertdetails",
                    data: json,
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    async: false,
                    success: function () { alert("success"); },
                    error: OnError,
                    failure: function () {
                        alert(response);
                    }
                });
                function OnError(request, status, error) {
                    alert(request.statusText);
                    return false;
                }
            });
        });
    &lt;/script&gt;
</code></pre>

<p>and i am also using the following code in csharp file:</p>

<pre><code> public static void insertdetails(string name,string emailid,string phone,string message)
{

    SqlConnection Con = new SqlConnection(@"Server=HP-PC;Integrated Security=True;"       +"Database=DB1");
    Console.WriteLine("connected to db");
    string query = "INSERT INTO [SubmissionFormTable]([Name],[Email],[Phone],[Message])" +
                "VALUES (@Name,@Email,@Phone,@Message)";

    SqlCommand cmd = new SqlCommand(query, Con);
    cmd.Parameters.AddWithValue("@Name", name);
    cmd.Parameters.AddWithValue("@Email", emailid);
    cmd.Parameters.AddWithValue("@Phone", phone);
    cmd.Parameters.AddWithValue("@Message", message);

    try
    {
        Con.Open();
        cmd.ExecuteNonQuery();
    }
    catch (Exception)
    {
        throw;
    }
    finally
    {
        Con.Close();
    }
</code></pre>

<p>That will be great if any one helps me clear out the error...</p>
