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

  • SEARCH
  • Home
  • 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 6770395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:18:25+00:00 2026-05-26T15:18:25+00:00

This is My Code Default.aspx: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd>

  • 0

This is My Code Default.aspx:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org
/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" 
Inherits="Sample001.Default" %>
<script src="jquery-1.6.4.min.js" type="text/javascript"></script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table>
            <tr>
                <td>
                    <asp:Label ID="lbl1" runat="server" />
                </td>
            </tr>
            <tr>
                <td>
                <asp:Label ID="masterlbl" Text="Master" runat="server" />
                </td>
                <td>
                    <span class="Mastercs">
                    <asp:DropDownList ID="ddl1" runat="server"/>
                    </span>
                </td>
                <td>
                <asp:Label ID="slavelbl" Text="Slave" runat="server" />
                </td>
                <td>
                    <span class="slavecs">
                    <asp:DropDownList ID="ddl2" runat="server"     />
                    </span>
                </td>
            </tr>
        </table>
    </div>
    </form>
    <script type="text/javascript">
        $(document).ready(function () {
            $('span.Mastercs select').change(function () {
                $.ajax({
                    type: "POST",
        url: "http://localhost/Sample001/Default.aspx/MyMethod",
                    data: "{}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (msg) {
                        $('#lbl1').text = msg;
                    }
                });
            });
        });
    </script>
</body>
</html>

This is Web.Config:

<?xml version="1.0"?>
<configuration>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <handlers>
                <add name="MyMethod" verb="*" path="*.assq" 
    type="Sample001.MyHandler,Sample001" preCondition="integratedMode" />
        </handlers>
    </system.webServer>
    <system.web>
        <compilation debug="true" targetFramework="4.0" />
    </system.web>
</configuration>

And Handler:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Sample001 {
    public class MyHandler : IHttpHandler {
        public bool IsReusable {
            get { return true; }
        }
        public void ProcessRequest(HttpContext context) {
        context.Response.Write("Yeeeeeeeeeeeeeee Like it");
        }
    }
}

I can’t config IIS 7.0 Correctly as 15Seconds said, just could add my custom extention(.assq) like this:

enter image description here

When load the page and change Select the script don’t work
enter image description here

And this is My Rsponse:

Unknown web method MyMethod.
Parameter name: methodName

body {font-family:”Verdana”;font-weight:normal;font-size:
.7em;color:black;}
p {font-family:”Verdana”;font-weight:normal;color:black;margin-top: -5px}
b {font-family:”Verdana”;font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:”Verdana”;font-weight:normal;font-size:18pt;color:red }
H2 { font-family:”Verdana”;font-weight:normal;font-
size:14pt;color:maroon }
pre {font-family:”Lucida Console”;font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy;
cursor:hand; }

        <span><H1>Server Error in '/Sample001' Application.<hr width=100% size=1 
color=silver></H1>

        <h2> <i>Unknown web method MyMethod.<br>Parameter name: methodName</i>  
</h2></span>

        <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

        <b> Description: </b>An unhandled exception occurred during the execution of 
the current web request. Please review the stack trace for more information about the 
error and where it originated in the code.

        <br><br>

        <b> Exception Details: </b>System.ArgumentException: Unknown web method 
MyMethod.<br>Parameter name: methodName<br><br>

        <b>Source Error:</b> <br><br>

        <table width=100% bgcolor="#ffffcc">
           <tr>
              <td>
                  <code>

An unhandled exception was generated during the execution of the current web request. 
Information regarding the origin and location of the exception can be identified using 
the exception stack trace below.</code>

              </td>
           </tr>
        </table>

        <br>

        <b>Stack Trace:</b> <br><br>

        <table width=100% bgcolor="#ffffcc">
           <tr>
              <td>
                  <code><pre>

[ArgumentException: Unknown web method MyMethod.
Parameter name: methodName]
System.Web.Handlers.ScriptModule.OnPostAcquireRequestState(Object sender, EventArgs  
eventArgs) +897827
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
+80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; 
completedSynchronously) +270
</pre></code>

              </td>
           </tr>
        </table>

        <br>

        <hr width=100% size=1 color=silver>

        <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; 
ASP.NET Version:4.0.30319.237

        </font>

    </body>
</html>
<!-- 
[ArgumentException]: Unknown web method MyMethod.
Parameter name: methodName
at System.Web.Handlers.ScriptModule.OnPostAcquireRequestState(Object sender, 
EventArgs  eventArgs)
at    System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep
.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&  
completedSynchronously)
-->

why this code not work?
Why the response say: Unknown web method MyMethod.?
is this because of config IIS 7.0 or other thing?

KBoek help to find what’s the problem:
main one is: this 3 element cause confused jQuery:

data: “{}”,
contentType: “application/json; charset=utf-8”,
dataType: “json”,

and I remove it.

  • 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-26T15:18:26+00:00Added an answer on May 26, 2026 at 3:18 pm

    I’d rather use the following setup:

    Call the following URL from JavaScript:

    "http://localhost/Sample001/MyMethod.assq"

    Then, register this URL in web.config

    <add name="MyMethod" verb="*" path="MyMethod.assq" type="Sample001.MyHandler,Sample001" preCondition="integratedMode" />

    You don’t have to register *.assq as a MIME type in IIS.

    By the way, neither your JavaScript nor your C# code present any data in JSON format. You don’t need that if you just want to return a string from the server. But of course, JSON is a good way to return a complete object to the client.

    Alternatives to identify “lbl1” from Javascript

    <asp:Label ID="lbl1" runat="server" CssClass="myLabel" />
    
    <script type="text/javascript">
      var label = $('.myLabel');
    </script>
    <span ID="lbl1">
    
    <script type="text/javascript">
      var label = $('#lbl1');
    </script>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my Default.aspx + jQuery Script: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
Here is my code: <%@ Page Language=C# AutoEventWireup=true CodeBehind=Default.aspx.cs Inherits=WebClient._Default %> <!DOCTYPE html PUBLIC
Assuming MyClass uses the default destructor (or no destructor), and this code: MyClass *buffer
I have this code, and it renders this HTML. How can I apply CSS
This code in JS gives me a popup saying i think null is a
This code is from Prototype.js . I've looked at probably 20 different tutorials, and
this code always returns 0 in PHP 5.2.5 for microseconds: <?php $dt = new
This code works (C# 3) double d; if(d == (double)(int)d) ...; Is there a
This code always works, even in different browsers: function fooCheck() { alert(internalFoo()); // We
This code does not seem to compile, I just need to write something to

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.