블로그 이미지
다비도프

만나고, 고백하고, 가슴 떨리고, 설레이고, 웃고, 사랑하고, 키스하고, 함께하고..

Rss feed Tistory
WEB/AJAX 2007. 3. 15. 11:04

AJAX in Action by Mohammad Azam : 대충 번역본

예전에 번역해논 문서... 자체번역이라 오역도 많고 대충 의역해버린 -_-;
어쨌든 Ajax 첫 실습으로는 좋은 듯한..

,
WEB/AJAX 2007. 3. 14. 16:08

Tips : Rico 1.1.2 breaks prototype 1.5.0_rc2 on firefox

링크 : http://forum.openrico.org/topic/2228#2539

증상 : Rico Beta를 1.1.2 로 패치하게 되면 FireFox에서 모든 Ajax Function이 안먹는다. :

원인 : Rico 1.1.2와 Prototype 1.5의 Header문제로 보임 :

해결책 : Prototype의 다음 부분을 수정한다.

,
WEB/AJAX 2007. 3. 14. 11:44

A Quick Guide How to start : AjaxPro

원문 : http://www.ajaxpro.info/quickguide.aspx

1. Download the latest Ajax.NET Professional files from www.schwarz-interactive.de
2. Add a reference to the AjaxPro.2.dll (for the .NET 1.1 Framework use AjaxPro.dll)
3. Add following lines to your 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>

4. Now, you have to mark your .NET methods with an AjaxMethod attribute:

[AjaxPro.AjaxMethod]
public DateTime GetServerTime()
{
  return DateTime.Now;
}

5. To use the .NET method on the client-side JavaScript you have to register the methods, this will be done to register a complete class to 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;
    }
  }
}

6. If you start the web page two JavaScript includes are rendered to the HTML source.
   To call a .NET method form the client-side JavaScript code you can use following syntax:

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);
}

,
WEB/AJAX 2007. 3. 9. 13:35

Ajax 활용시 고려해야 될 점..

1.  Ajax를 사용한 이벤트 처리시에 디자인이 깨지는 거 고려해야 되요~ [2007.01.30]

자.. 무슨 말이냐..
Ajax를 사용해서 이벤트를 처리하고 그 뒷처리까지 깨끗이 했으면!!
분명히 무언가 바꼈을끄에요.
무언가 바꼈으니 레이아웃도 조곰 변경됐을텐데!!
나머지부분은 적용이 안된다는 거~!!
그러니까 리플을 예로 들믄

      1) 리플 삭제 -> Ajax
      2) CallBack 처리 - 삭제 결과값
      3) 리플 리스트 다시 바인딩하고 -> Ajax

여기까지 하면 리플 아래에 있는 Footer 같은 거.
아님 머 이미지 네비 같은거.
아님 글 리스트 같은 건
제자리에 그대로 있다는 거~!!

그러니까 저기서 끈나는게 아니라 변경된 레이아웃까지 다시 잡아줘야 된다는 거..


2. CS단의 Ajax Method에서는 Data값이 남아있지 않아요~ [2007.01.30]
이건 조금 하믄 당근 아는거..

   [cs]

   private int aaa = 1;
   private void Page_Load(object sender, System.EventArgs e)
  {
       AjaxPro.Utility.RegisterTypeForAjax(typeof(Viewer));
     
      // 이렇게 aaa를 cs단에 박아넣어도..
      if(Request.QueryString["aa"] != null
          && Request.QueryString["aa"].ToString() != "")
       this.aaa = int.Parse(Request.QueryString["aa"]);
  }

   [AjaxPro.AjaxMethod]
   public bool Delete(int ID)
  {
        // 불러도 이건 쓰레기값~!!
        return this.aaa;
  }


3. AjaxPro.AjaxMethod는 Overload가 되지 않습니다요~ [2007. 2. 12]

cs단에 아래와 같이 이름이 같고, 파라미터가 다르게 오버로드를 하려고 해도 AjaxPro에서는
함수 Overloading을 지원하지 않기때문에 스크립트에서 정의되지 않은 / 정확한 파라미터가 아니라는 에러가 난다.

    [cs]

    [AjaxPro.AjaxMethod]
    public bool CreateContentReply(int ZMID, int ZMCID, string Name){...}

    [AjaxPro.AjaxMethod]
    public bool CreateContentReply(int ZMID, int ZMCID){...}


    [Html]
    AjaxPro.PG.Viewer.CreateContentReply(ZMID, ZMCID, Name, CallBack_proc);
    AjaxPro.PG.Viewer.CreateContentReply(ZMID, ZMCID, CallBack_proc);   Error
,
TOTAL TODAY