asp.net ajax 1º semestre 2010 > pucpr > bsi bruno c. de paula
TRANSCRIPT
![Page 1: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/1.jpg)
ASP.NET Ajax
1º Semestre 2010 > PUCPR > BSI
Bruno C. de PaulaBruno C. de Paula
![Page 2: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/2.jpg)
ASP.NET Ajax
http://ajax.asp.netFramework da Microsoft para
implementação de Ajax;Formado por 3 partes:
ASP.NET Ajax Extensions (Server);ASP.NET Ajax Control Toolkit;ASP.NET Ajax Library / jQuery
(Client);
2
![Page 3: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/3.jpg)
ASP.NET Ajax Extensions
Já instalado no Visual Studio 2008;Transformam código “não-Ajax” em Ajax
(“ajaxificação”);
3
![Page 4: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/4.jpg)
ScriptManager
Modifica o comportamento do postback do cliente;
Todas as páginas que vão trabalhar com Ajax devem possuir um ScriptManager;
Já existe um modelo pronto de web form com ScriptManager;
4
![Page 5: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/5.jpg)
Chamando métodos de servidor via Ajax
O ScriptManager também permite que se chame métodos do servidor via JavaScript;
Propriedade EnablePageMethods=true;
Útil para integrar sistemas JS com ASP.NET.
5
![Page 6: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/6.jpg)
UpdatePanel
Marca os componentes que poderão sofrer atualização parcial;
Dentro de um UpdatePanel vão os componentes “ajaxificados”;
Só colocar UpdatePanel no que se deseja ajaxificar;
6
![Page 7: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/7.jpg)
Exemplo UpdatePanel7
![Page 8: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/8.jpg)
Só o botão é recarregado!8
![Page 9: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/9.jpg)
UpdateProgress
Visualização a ser mostrada enquanto a página estiver carregando;
“Acalma” o usuário; Ícone ou mensagem de carregamento;Prefira colocar ícones Ajax:
http://www.ajaxload.info/
9
![Page 10: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/10.jpg)
ScriptManagerProxy
O ScriptManager pode ser colocado na MasterPage;
ScriptManagerProxy deve ser colocado em uma página de conteúdo, se já existir ScriptManager na Master;
10
![Page 11: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/11.jpg)
ASP.NET Ajax Control Toolkit
Dezenas de controles ricos (similar jQuery UI);
Open Source e desenvolvido pela comunidade;
Diversos bugs, cuidado! Alguns controles utilizam a
metáfora de extenders:Controle que melhora as
características já existentes de outro.
Precisa ser instalado!
1111/04/23
![Page 12: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/12.jpg)
Modificação de comportamento via extenderCada controle pode ter associado um
ou mais extenders;
12
![Page 13: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/13.jpg)
Propriedade TargetControlId indica a associação
13
![Page 14: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/14.jpg)
O componente ganha novas propriedades
14
![Page 15: ASP.NET Ajax 1º Semestre 2010 > PUCPR > BSI Bruno C. de Paula](https://reader033.vdocuments.us/reader033/viewer/2022051820/552fc0fe497959413d8bbac8/html5/thumbnails/15.jpg)
Conheça os controles!
http://www.asp.net/ajax/ajaxcontroltoolkit/samples/
15