Download Now Code Base AsyncDocs Contact Us
asyncPlaceHolder
liveDemo
  • Select an AsyncControl to create and then click "Add AsyncControl". The AsyncControl will be added to the AsyncPlaceHolder and then shown.
  • Remove the control by clicking "Remove AsyncControl", then following the 'popup' instructions.
  • The dynamically added AsyncControls retain there assigned event handlers after every AsyncCallback.

Add a dynamically created AsyncControl

Dynamically Create:

Description

The AsyncPlaceHolder provides you with fast, and lightweight dynamic control creation.



Features
  • Allows you to easily manipulate the internal controls collection during AsyncCallbacks.
  • Change the visibility during an AsyncCallback.
   
<%@ Register Assembly="AsyncControls" Namespace="DelvingWare.AsyncControls" TagPrefix="dw" %>

<dw:AsyncLabel runat="server" ID="lblMain" 
RenderMode="Paragraph" 
CssClass="placeHolderLabel">Add a dynamically created AsyncControl</dw:AsyncLabel>

<dw:AsyncPlaceHolder runat="server" ID="phMain" />

<p>
<dw:AsyncButton runat="server" ID="btAdd" 
OnClick="btAdd_Click" 
CausesValidation="true" 
Text="Add AsyncControl"
CssClass="greyButton" />

<dw:AsyncButton runat="server" ID="btRemove" 
OnClick="btRemove_Click"
CausesValidation="true" 
Text="Remove AsyncControl" 
CssClass="greyButton"/>
</p>

<p>
Dynamically Create: <dw:AsyncDropDownList runat="server" ID="drpMain" 
EnableValidation="enabled" 
InitialValue="none"
ErrorMessageCssClass="errorMsg"
ErrorMessage="Please select a valid control.">
    <dw:AsyncListItem Value="none" />
    <dw:AsyncListItem Value="window">AsyncWindow</dw:AsyncListItem>
    <dw:AsyncListItem Value="link">AsyncLinkButton</dw:AsyncListItem>
    <dw:AsyncListItem Value="button">AsyncButton</dw:AsyncListItem>
</dw:AsyncDropDownList>
</p>