Callbacks Callbacks allow a control or page to perform an out-of-band call back to the server in a manner that does not require the page to be posted back entirely. This means that your custom control does not cause the client browser to wait on an entire page post back and your custom control can enable rich UI functionality. You can develop a custom control that easily combines for example, web resources with client script management to make use of the call back infrastructure. To enable a call back you will: Create a server-side call back event with a given signature in your custom control, (ICallbackEventHandler.PrepareCallbackEvent) that acts on an argument passed into the method<. You should call on a method that developers can override if they extend your custom control; Create a server-side method that generates the result for the call back, ICallbackEventHandler.RenderCallbackResult. You should call a method that developers can override if they extenf your control. The return result will be passed to client-side script defined by your custom control; Create client-side script that manages the return call or error. This will be generated through your custom control; Use the callback event reference hooked up to a client-side event in your custom control. public class CustomControl : CompositeControl void ICallbackEventHandler.PrepareCallbackEvent(string eventArgument) { PrepareCallBackEvent(eventArgument); } String ICallbackEventHandler.RenderCallbackResult() { return RenderCallbackResult(); } private String _callbackEventArg; // Do work in a protected virtual methods so that derived controls can override protected virtual void PrepareCallBackEvent(string eventArgument) { _callbackEventArg = eventArgument; } protected virtual String RenderCallbackResult() { if (_callbackEventArg == "theArg") return = "Some data"; return "Only theArg allowed!"; } // Additional implementation // Client script functions that handle the callback private String sButtonCallBack = "function ButtonCallBack(result, context) { alert(result); }"; private String sButtonCallBackError = "function ButtonErrorCallBack(result, context) { alert(result); }"; protected override void OnInit(EventArgs e) { base.OnInit(e); // Additional implementation Page.ClientScript.RegisterClientScriptBlock(typeof(CustomControl), "ButtonCallBack", sButtonCallBack, true); Page.ClientScript.RegisterClientScriptBlock(typeof(CustomControl), "ButtonCallBackError", sButtonCallBackError, true); } // Additional implementation protected override void OnPreRender(EventArgs e) { // Set up the OnClick event to fire an out-of band call to the handler Attributes["OnClick"] = Page.ClientScript.GetCallbackEventReference(this, "'theArg'", "ButtonCallback", "null", "ButtonErrorCallback", true); base.OnPreRender(e); } } Aplicativos de site da Web podem conter uma variedade de tipos de arquivo, alguns suportados e gerenciados pelo ASP.NET, e outros suportados e gerenciados pelo servidor IIS. A maioria dos tipos de arquivo do ASP.NET pode ser gerada automaticamente usando o item de menu Add New Item no Visual Developer da Web. Tipos de arquivo sao mapeados para aplicativos usando mapeamentos de aplicativo. Por exemplo, se voce abrir um arquivo com a extensao .txt, o aplicativo bloco de notas sera aberto, provavelmente porque os tipos de arquivo .txt sao mapeados por padrao para notepad.exe. Tipos de arquivo gerenciados pelo ASP.NET Os tipos de arquivo que sao gerenciados pelo ASP.NET sao mapeados para o Aspnet_isapi.dll no IIS. Tipo de arquivo Local Descricao .asax Raiz de aplicativo. Normalmente um arquivo Global.asax que contem codigo que deriva da classe HttpApplication e representa o aplicativo. Para obter mais informacoes, consulte Sintaxe Global.asax. .ascx Raiz do aplicativo ou uma subpasta. Um arquivo de controle de