ASP.NET AJAX 컨트롤 사용시 Sys is not defined 에러 처리

[문제의 원인]
Sys is not defined 라는 에러는 Sys 라는 글로벌 변수가 javascript 에서 정의가 되어 있지않아서 생긴문제다.
이문제가 왜 일어날까?..

[문제의 발단]
작년에 ASP.NET 2.0 AJAX 컨트롤 기반으로 웹개발후, 프레임웍과 개발툴을 업그레이드한후,
개발한 사이트를 돌렸을경우 AJAX 컨트롤에서 버젼 오류가 생겼다.
즉, AJAX Lib 1.0 과 AJAX Lib 3.0 어셈블리가 서로 버젼을 충돌을 일으켰다.

[원인 분석]
내가 이문제를 겪은 주원인은 .NET Framework 2.0 에서 3.0 으로 업그레이드하고,.. VS2008 beta 버젼을 다운로드해서 사용하다가. 정식 버젼인 Visual Studio 2008 Express  버젼이 나오면서 업그래이드 후에 나타난 문제다.

내가 여기서 실수한건 베타 버젼을 제대로 못지우고, 설치를 강행해서 그런거 같다. 즉, 레지스트리 파일을 열어서 강제로 설정 레지스트리를 지웠지만, 실제로 맴핑되어있던 Assembly와 DLL 파일을 지우지도 못했고, 그밖에 찌꺼기 레지를 지우지 못해서 설정이 꼬였던거 같다.

[해결책]
여튼,  해결한 방법은 간단했다.
기존에 백업해두었던.. Web.config 파일을 덮어 씌웠는데.. 바로 해결됐다..-ㅜ..
(젠장 3일이나 삽질했다..ㅜㅜ..)

.NET Framework 2.0 기반의 Ajax 1.0 컨트롤 설정은 아래와 같다.

업그레이드후 Web.config 파일을 기존 버젼과 비교해 보니 아래 빨간색 부분이 누락되어있었고…녹색부분의 색션부분의 Extensions 버전이 달랐다..

<?xml version=”1.0″?>
<configuration>
  <configSections>
    <sectionGroup name=”system.web.extensions” type=”System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″>
      <sectionGroup name=”scripting” type=”System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″>
        <section name=”scriptResourceHandler” type=”System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ requirePermission=”false” allowDefinition=”MachineToApplication”/>
        <sectionGroup name=”webServices” type=”System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″>
          <section name=”jsonSerialization” type=”System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ requirePermission=”false” allowDefinition=”Everywhere”/>
          <section name=”profileService” type=”System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ requirePermission=”false” allowDefinition=”MachineToApplication”/>
          <section name=”authenticationService” type=”System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ requirePermission=”false” allowDefinition=”MachineToApplication”/>
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
  </configSections>
  <connectionStrings>
    <add name=”RIKIConnectionString” connectionString=”Data Source=RIKI;Initial Catalog=RikiDB;Persist Security Info=True;User ID=*********;Password=*******” providerName=”System.Data.SqlClient”/>
  </connectionStrings>
  <system.web>
    <pages>
      <controls>
        <add tagPrefix=”asp” namespace=”System.Web.UI” assembly=”System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
        <add namespace=”AjaxControlToolkit” assembly=”AjaxControlToolkit” tagPrefix=”ajaxToolkit”/>
      </controls>
    </pages>
    <!–
          Set compilation debug=”true” to insert debugging
          symbols into the compiled page. Because this
          affects performance, set this value to true only
          during development.
    –>
    <compilation debug=”true”>
      <assemblies>
        <add assembly=”System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
        <add assembly=”System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″/>
        <add assembly=”System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A”/>
        <add assembly=”System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089″/>
      </assemblies>
    </compilation>
    <httpHandlers>
      <remove verb=”” path=”.asmx”/>
      <add verb=”” path=”.asmx” validate=”false” type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
      <add verb=”” path=”_AppService.axd” validate=”false” type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
      <add verb=”GET,HEAD” path=”ScriptResource.axd” type=”System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ validate=”false”/>
      <add verb=”GET” path=”FtbWebResource.axd” type=”FreeTextBoxControls.AssemblyResourceHandler, FreeTextBox”/>
    </httpHandlers>
    <httpModules>
      <add name=”ScriptModule” type=”System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
    </httpModules>
    <authentication mode=”Forms”>
      <forms name=”.AUTHCOOKIE” loginUrl=”login/login.aspx” protection=”All”/>
    </authentication>
    <authorization>
      <deny users=”?”/>
    </authorization>
  </system.web>
  <system.web.extensions>
    <scripting>
      <webServices>
        <!– Uncomment this line to customize maxJsonLength and add a custom converter –>
        <!–
      <jsonSerialization maxJsonLength=”500″>
        <converters>
          <add name=”ConvertMe” type=”Acme.SubAcme.ConvertMeTypeConverter”/>
        </converters>
      </jsonSerialization>
      –>
        <!– Uncomment this line to enable the authentication service. Include requireSSL=”true” if appropriate. –>
        <!–
        <authenticationService enabled=”true” requireSSL = “true|false”/>
      –>
        <!– Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
           and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
           writeAccessProperties attributes. –>
        <!–
      <profileService enabled=”true”
                      readAccessProperties=”propertyname1,propertyname2″
                      writeAccessProperties=”propertyname1,propertyname2″ />
      –>
      </webServices>
      <!–
      <scriptResourceHandler enableCompression=”true” enableCaching=”true” />
      –>
    </scripting>
  </system.web.extensions>
  <system.webServer>
    <validation validateIntegratedModeConfiguration=”false”/>
    <modules>
      <add name=”ScriptModule” preCondition=”integratedMode” type=”System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
    </modules>
    <handlers>
      <remove name=”WebServiceHandlerFactory-Integrated”/>
      <add name=”ScriptHandlerFactory” verb=”*” path=”*.asmx” preCondition=”integratedMode” type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
      <add name=”ScriptHandlerFactoryAppServices” verb=”*” path=”*_AppService.axd” preCondition=”integratedMode” type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.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=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>

    </handlers>
  </system.webServer>
</configuration>

불꽃남자

UI 개발자

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.