none
ajax 에러 This method is either not marked ..... 질문이요 RRS feed

  • 질문

  • 안녕하세요 ^^ ㅠㅠ답을 구하고자 이렇게 글을 씁니다.

    웹화면을 띄우고 나서 시간이 지나면

    This method is either not marked with an AjaxMethod or id not available.


    위의 에러가 간헐적으로 발생하는데요

    왜 그런지 도통 이해를 못하겠더군요



    사이트 서핑으로 몇개 찾아봐도 잘 안먹고 ㅠㅠ

    web.config 에서 셋팅을 해줘야 한다는데

    일단 여기서 제가 한 셋팅을 보여드리자면



    <ajaxNet>
    <ajaxSettings>
      <urlNamespaceMappings useAssemblyQualifiedName="false" allowListOnly="false">
       <add type="HsWeb.HsMain.App_Code" path="mypathXYZ"/>
      </urlNamespaceMappings>
    </ajaxSettings>
    </ajaxNet>



    이겁니다.

    뭐가 문제가 있을까요?




    밑에는 전체 web.config 입니다.



    <?xml version="1.0"?>
    <configuration>
    <configSections>
      <sectionGroup name="system.web.extensions"
    type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions,
    Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
       <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup,
    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="scriptResourceHandler"
    type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions,
    Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"
    allowDefinition="MachineToApplication"/>
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
         <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection,
    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    requirePermission="false" allowDefinition="Everywhere"/>
         <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection,
    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    requirePermission="false" allowDefinition="MachineToApplication"/>
         <section name="authenticationService"
    type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions,
    Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"
    allowDefinition="MachineToApplication"/>
         <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection,
    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    requirePermission="false" allowDefinition="MachineToApplication"/>
        </sectionGroup>
       </sectionGroup>
      </sectionGroup>
      <sectionGroup name="ajaxNet">
       <!--
        If you are using Microsoft .NET 1.1 please remove the two attributes
        requirePermission and restartOnExternalChanges, they are only supported
        with .NET 2.0.
       -->
       <section name="ajaxSettings" type="AjaxPro.AjaxSettingsSectionHandler,AjaxPro.2"
    requirePermission="false" restartOnExternalChanges="true"/>
      </sectionGroup>
    </configSections>
    <ajaxNet>
      <ajaxSettings>
       <urlNamespaceMappings useAssemblyQualifiedName="false" allowListOnly="false">
        <add type="HsWeb.HsMain.App_Code" path="mypathXYZ"/>
       </urlNamespaceMappings>
      </ajaxSettings>
    </ajaxNet>
    <appSettings>
      <add key="CrystalImageCleaner-AutoStart" value="true"/>
      <add key="CrystalImageCleaner-Sleep" value="60000"/>
      <add key="CrystalImageCleaner-Age" value="120000"/>
    </appSettings>
    <connectionStrings>
      <add name="ConnectionString" connectionString="Data Source=NTMS;Persist Security Info=True;User
    ID=HERP_HIMP;Password=HERP_HIMP;Unicode=True" providerName="System.Data.OracleClient"/>
    </connectionStrings>
    <system.web>
      <!--<identity impersonate="true" userName="administrator" password="wjstksntmsweb"/>-->
      <!--
                컴파일된 페이지에 디버깅 기호를 삽입하려면
                compilation debug="true"로 설정하십시오. 이렇게 하면
                성능에 영향을 주므로 개발하는 동안에만 이 값을
                true로 설정하십시오.
            -->
      <compilation debug="true">
       <assemblies>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral,
    PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
    PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral,
    PublicKeyToken=B77A5C561934E089"/>
        <add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral,
    PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral,
    PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="Microsoft.JScript, Version=8.0.0.0, Culture=neutral,
    PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="DEXTUpload.NET, Version=3.6.2.0, Culture=neutral,
    PublicKeyToken=D71D611CCD9CC3C0"/>
        <add assembly="CrystalDecisions.CrystalReports.Engine, Version=11.5.3700.0, Culture=neutral,
    PublicKeyToken=692FBEA5521E1304"/>
        <add assembly="CrystalDecisions.Shared, Version=11.5.3700.0, Culture=neutral,
    PublicKeyToken=692FBEA5521E1304"/>
        <add assembly="CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral,
    PublicKeyToken=692FBEA5521E1304"/>
        <add assembly="CrystalDecisions.ReportSource, Version=11.5.3700.0, Culture=neutral,
    PublicKeyToken=692FBEA5521E1304"/>
        <add assembly="CrystalDecisions.Enterprise.Framework, Version=11.5.3300.0, Culture=neutral,
    PublicKeyToken=692FBEA5521E1304"/>
        <add assembly="CrystalDecisions.Enterprise.Web, Version=11.5.3300.0, Culture=neutral,
    PublicKeyToken=692FBEA5521E1304"/>
        <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=11.5.3300.0, Culture=neutral,
    PublicKeyToken=692FBEA5521E1304"/></assemblies>
       <buildProviders>
        <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common,
    Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
       </buildProviders>
      </compilation>
      <!--
                <authentication> 섹션에서는 ASP.NET에서 사용되는
                보안 인증 모드의 구성을 설정하여 들어오는
                사용자를 식별할 수 있습니다.
            -->
      <authentication mode="Forms">
       <forms loginUrl="HsLogin.aspx" timeout="2880"/>
      </authentication>
      <authorization>
       <allow users="?"/>
       <!-- 모든 사용자를 허용합니다. -->
       <!--  <allow     users="[쉼표로 구분된 사용자 목록]"
                                 roles="[쉼표로 구분된 역할 목록]"/>
                      <deny      users="[쉼표로 구분된 사용자 목록]"
                                 roles="[쉼표로 구분된 역할 목록]"/>
                                
                -->
      </authorization>
      <!--
                <customErrors> 섹션에서는 요청을 실행하는 동안
                처리되지 않은 오류가 발생하는 경우 수행할 작업을
                구성할 수 있습니다. 특히 이 섹션에서는
                개발자가 오류 스택 추적 대신 html 오류 페이지가 표시되도록
                구성할 수 있습니다.

            <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
            -->
      <customErrors mode="Off"/>
      <pages>
       <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0,
    Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions,
    Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
       </controls>
      </pages>
      <httpHandlers>
       <remove path="*.asmx" verb="*"/>
       <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory,
    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    validate="false"/>
       <!--<add path="*.ashx" verb="*" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>-->
       <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory,
    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    validate="false"/>
       <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler,
    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    validate="false"/>
       <add path="CrystalImageHandler.aspx" verb="GET" type="CrystalDecisions.Web.CrystalImageHandler,
    CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
          <add path="Reserved.ReportViewerWebControl.axd" verb="*"
    type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
       <!--<add path="*.ashx" verb="GET" type="HsWeb.WorkFlow.IT.GetImage"/>-->
      </httpHandlers>
      <httpModules>
       <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions,
    Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </httpModules>
      <!--<globalization
          fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8"
          culture="ko-KR"
          uiCulture="ko-KR"
        />-->
      <httpRuntime maxRequestLength="20480"/><!-- 이미지 업로드 시의 파일 용량 제한(20480 = 20MB)-->
    </system.web>
    <system.codedom>
      <compilers>
       <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
    type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=b77a5c561934e089">
        <providerOption name="CompilerVersion" value="v3.5"/>
        <providerOption name="WarnAsError" value="false"/>
       </compiler>
      </compilers>
    </system.codedom>
    <!--
            IIS(Internet Information Services) 7.0에서 ASP.NET AJAX를 실행하려면
            system.webServer 섹션이 필요합니다. 이전 버전의 IIS에서는 필요하지 않습니다.
        -->
    <system.webServer>
      <validation validateIntegratedModeConfiguration="false"/>
      <modules>
       <remove name="ScriptModule"/>
       <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule,
    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </modules>
      <handlers>
       <remove name="WebServiceHandlerFactory-Integrated"/>
       <remove name="ScriptHandlerFactory"/>
       <remove name="ScriptHandlerFactoryAppServices"/>
       <remove name="ScriptResource"/>
       <add name="mvc" path="*" verb="*" modules="IsapiModule"
    scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
    resourceType="Unspecified" requireAccess="None"
    preCondition="classicMode,runtimeVersionv2.0,bitness32"/>
       <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
    type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0,
    Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
       <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd"
    preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory,
    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
       <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd"
    type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0,
    Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add name="CrystalImageHandler.aspx_GET" path="CrystalImageHandler.aspx" verb="GET"
    type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=11.5.3700.0,
    Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/>
          <!--<add name="AjaxPro2" path="*.ashx" verb="*" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>-->
       <!--<add name="GetImage" path="GetImage.ashx" verb="GET" type="HsWeb.WorkFlow.IT.GetImage"
    resourceType="Unspecified"/>-->
      </handlers>
      <directoryBrowse enabled="true"/>
      <defaultDocument>
       <files>
        <remove value="default.aspx"/>
        <remove value="iisstart.htm"/>
        <remove value="index.html"/>
        <remove value="index.htm"/>
        <remove value="Default.asp"/>
        <remove value="Default.htm"/>
        <add value="HsLogin.aspx"/>
       </files>
      </defaultDocument>
    </system.webServer>
    <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
       </dependentAssembly>
       <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
       </dependentAssembly>
      </assemblyBinding>
    </runtime>
    <location path="ajaxpro">
      <system.webServer>
       <handlers>
        <add name="AjaxPro" verb="GET,POST" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
       </handlers>
       <modules>
        <add name="HttpCompressionModule" type="AjaxPro.HttpCompressionModule,AjaxPro.2"/>
       </modules>
      </system.webServer>
      <system.web>
       <httpHandlers>
        <add verb="GET,POST" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
       </httpHandlers>
       <httpModules>
        <add name="HttpCompressionModule" type="AjaxPro.HttpCompressionModule,AjaxPro.2"/>
       </httpModules>
       <authorization>
        <allow users="?"/>
       </authorization>
      </system.web>
    </location>
    </configuration>
    2013년 2월 26일 화요일 오전 1:14

답변

  • 현재 동일한 이슈에대해서 원인과 해결책이 확인되지 않습니다.

    아래 ASP.NET Spiced: AJAX  사용하기 위한 방법을 확인 하시기 바랍니다.

    Ajax.NET Professional files 다운로드합니다.

    AjaxPro.2.dll 추가합니다.

    아래와 같이 web.config를 설정합니다.

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.web>
        <httpHandlers>
          <add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
        </httpHandlers>
    ...
      </system.web>
    </configuration>

    AjaxMethod속성을 사용하여NET 구현합니다.

    public DateTime GetServerTime()
    {
      return DateTime.Now;
    }

    클라이언트 측 자바 스크립트에서NET방법을사용하려면Ajax.NET의 전체클래스를등록합니다.

    namespace MyDemo
    {
      public class _Default
      {
        protected void Page_Load(object sender, EventArgs e)
        {
          AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default));
        }
    
        [AjaxPro.AjaxMethod]
        public DateTime GetServerTime()
        {
          return DateTime.Now;
        }
      }
    }

    다음 아래와 같이 자바스크립트에서 구현합니다.

    function getServerTime()
    {
      MyDemo._Default.GetServerTime(getServerTime_callback);  // asynchronous call
    }
    
    // This method will be called after the method has been executed
    // and the result has been sent to the client.
    
    function getServerTime_callback(res)
    {
      alert(res.value);
    }

    [참조자료]

    ASP.NET Spiced: AJAX


    제시해 드린 답변이 도움이 되었기를 바랍니다.

    답변이 문제 해결에 도움이 되었다면 답변으로 채택을 부탁드립니다.
    하지만 문제 해결이 되지 않아서 정확한 답변을 원하는 경우에는 문제의 정보를 더 자세하게 답변으로 제공해주시기 바랍니다.


    • 답변으로 표시됨 seolchos 2013년 2월 26일 화요일 오전 9:52
    2013년 2월 26일 화요일 오전 3:06
    중재자