UpdatePanels를 사용하여 ASP.NET 아약스 포스트 백을 수행하는 페이지가 있습니다. 일부 자바 스크립트에서는 window.onload 이벤트에 몇 가지 객체를 설정했습니다. 다시 게시 할 때 내 개체가 엉망이 된 것 같습니다.아약스가 내 자바 스크립트 개체를 깨는 건가요?
테이블에서 이벤트를 수신하는 하나의 오브젝트는 더 이상 이벤트를 수신하지 않습니다. 또한 버튼에 대한 로컬 참조가있는 객체가 해당 객체를 업데이트 할 수없는 경우도있었습니다. 내가 다시 게시 할 후에 나는 GoDirty() 함수에서 그랬던 것처럼 내가 그들을 다시하지 않는 그래서, 버튼 참조가 엉망이되어
function EditItemPage(clientId)
{
this.saveButton = $get(clientId + ""_{2}"")
this.publishButton = $get(clientId + ""_{3}"")
this.exitButton = $get(clientId + ""_{4}"")
EditItemPage.prototype.GoDirty = function()
{
//it works if i add these, but i'd rather not have to.
this.saveButton = $get(clientId + ""_{2}"")
this.publishButton = $get(clientId + ""_{3}"")
this.exitButton = $get(clientId + ""_{4}"")
this.saveButton.disabled = false;
this.publishButton.value = 'Save and Publish';
this.exitButton.value = 'Discard changes and Exit';
}
}
: 여기에 엉망지고 있었다 자바 스크립트 버튼입니다.
어떤 통찰력이라도 있습니까?