완벽하게 작동하는 VS2010에서 ReportViewer (rdlc) 컨트롤을 사용하여 Azure 웹 응용 프로그램에서 보고서를 보여줍니다. 최근에 내 클라이언트에서 ReportViewer의 Print 이벤트를 캡처하고 서버에 항목을 기록하도록 요청했습니다. 인쇄 버튼으로 연결했습니다. 로컬 환경에서 웹 응용 프로그램을 실행할 때 완벽하게 작동합니다. 그러나 Azure에서 Ajax 메서드는 클라이언트 측에서 호출되지 않습니다. 할 일을 제안하십시오. Azure 환경에서 Ajax에 대한 제한 사항이 있습니까?Windows Azure의 AjaxMethods가 작동하지 않습니다.
내가
protected void Page_Load(object sender, EventArgs e)
{
Ajax.Utility.RegisterTypeForAjax(typeof(Pages.Report));
ImageButton btnPrint = new ImageButton();
btnPrint = ((ImageButton)(this.FindControl("ctl00$" + ReportViewer1.ClientID.Replace("_","$") + "$ctl06$ctl06$ctl00$ctl00$ctl00")));
btnPrint.Attributes["onclick"] += "attachEventForPrint();";
}
[AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
public static void LogEvent(int pLoggingEvent)
{
// Addded logic to log event
}
뒤에 그리고 ASPX 파일 다음 함수에 코드를 Page_Load에 페이지를 등록하고있어이
function attachEventForPrint() {
if (typeof (Report) != "undefined") {
Report.LogEvent(4);
}
}
의 어떤 시점에서 본다 필자는 Microsoft Ajax를 사용한 적이 없지만 jQuery와 Ajax를 MVC 응용 프로그램에서 문제없이 사용할 수 있습니다. – vtortola