The remote server returned an error: (405) Method Not Allowed. c#
<p>So i works in a project to send data from an c# application to Asp web application, the problem is when i want to send the data i got this error :<strong>The remote server returned an error: (405) Method Not Allowed.</strong>, here is my c# code:</p>

<pre><code>    static void Main(string[] args)
    {
        using (var wb = new WebClient())
        {
            var data = new NameValueCollection();
            string url = "http://localhost:4241/HtmlPage2.html";
            data["Text1"] = "Anas";
            data["Text2"] = "Anas";
            var response = wb.UploadValues(url, "POST", data);
        }
    }
</code></pre>

<p>and here my Asp code <strong>(**it just a HTML page for testing, the code is implemented in *<em>HtmlPage2.html</strong> and  when i submit the button it passed the data to <strong>HtmlPage2.html</em>*</strong>)**</p>

<pre><code>    &lt;!DOCTYPE html&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;
    &lt;title&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form method="Post" action="HtmlPage2.html"&gt;
        &lt;input id="Text1" type="text" name="Text1" /&gt;
        &lt;input id="Text2" type="text" name="Text2" /&gt;
        &lt;input id="Button1" type="submit" value="button" /&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>NB:My IIS is already enabled :)
So plz plz if someone can help me i will be very appreciate :)</p>
