2012-01-16 3 views
2

Ajax Toolkit CascadingDropDon로드에서 JavaScript/jQuery 이벤트를 생성 할 수 있는지 알고 싶습니다.Ajax Toolkit CascadingDropDown onload 이벤트?

시나리오 : 내가 먼저 드롭 다운에서 항목을 선택하고

-> 두 번째 드롭 다운이 아약스 툴킷 계단식 드롭 기능을 사용하여로드 ->이 내 자바 스크립트 함수의 화재에 대한 반응한다.

답변

2

해냈어!

CascadinDropDown 선언에서 내가 BehaviourID를 추가했습니다 : 스크립트에서

<cc1:CascadingDropDown 
ID="CascadingDDL" 
TargetControlID="childDDL" 
ParentControlID="parentDDL" 
Category="ddl" 
PromptText="Select" 
ServicePath="~/webmethods.asmx" 
runat="server" **BehaviorID="cddBehaviourID"** 
ServiceMethod="GetValuesForDDL" Enabled="True"> 
</cc1:CascadingDropDown> 

:

function pageLoad(sender, args) { //For Ajax toolkit to fire on 'window.onload' 

     var behavior = $find('<%=CascadingDDL.BehaviurID %>'); 

     if (behavior != null) { 

      behavior.add_populated(function() { *what you want to execute* }); 

     } 
} 
+0

남자, 내가 이걸 발견 다행

여기 방법입니다. 특정 상황에서 CascadingDrowpDown에 의해 제어되는 드롭 다운 목록에 옵션 항목을 추가해야했습니다. 나는이 게시물을 읽을 때까지 그것을 알아낼 수 없었다. – paparush