Simply put a Callback Panel inside the form and other controls that you want to AJAX-update inside the Callback Panel; When multiple Callback Panels are grouped together, triggering any one of them triggers them all. Ideal for updating different regions in the same page with one AJAX call;
A sample Example on this Topic.
Test1.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test1.aspx.vb" Inherits="Test1" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<eo:CallbackPanel ID="cbpTargetTable" runat="server"
ClientSideAfterUpdate ="ShowDialogs" LoadingDialogID="dlgProcessing" Width="100%" AutoDisableContents="true"
Triggers="{ControlID:Dialog1;Parameter:};{ControlID:ddltest1;Parameter:};{ControlID:ddltest2;Parameter:}" >
<center>
<table cellpadding="2" cellspacing="6">
<tr>
<td align="left" ><asp:Label ID="Lbltest1" runat="server" Text="Test1 DDL"></asp:Label></td>
<td align="left" ><asp:DropDownList AutoPostBack="true" ID="ddltest1" Width="135" runat="server">
<asp:ListItem Text="--Select--"></asp:ListItem>
<asp:ListItem Text ="Cars"></asp:ListItem>
<asp:ListItem Text="Bikes"></asp:ListItem>
</asp:DropDownList> </td>
</tr>
<tr>
<td align="left"><asp:Label ID="Lbltest2" runat="server" Text="Test2 DDL"></asp:Label></td>
<td align="left"><asp:DropDownList AutoPostBack="true" Enabled ="false" Width="135" ID="ddltest2" runat="server"></asp:DropDownList></td>
</tr>
<tr>
<td><a runat="server" href="#" id="HypCustomer" onclick="eo_GetObject('Dialog1').show();" >View EO POPUP DIALOG</a></td>
</tr>
</table>
<eo:dialog HeaderHtml="History" ActivateOnClick="true" BackShadeColor="Blue" ContentHtml="EO Dialog POPUP DEMO" runat="server" Height="400" Width="400" id="Dialog1" ControlSkinID="None"
BorderStyle="Solid" CloseButtonUrl="00070101" BorderWidth="1px"
ShadowColor="LightGray" BorderColor="#335C88" ShadowDepth="3"
MinimizeButtonUrl="00070102"
AllowResize="True"
RestoreButtonUrl="00070103"
ResizeImageUrl="00020014"
AcceptButton="btnOK"
AcceptButtonPostBack="true">
<headerstyleactive csstext="padding-right: 4px; padding-left: 4px; font-size: 11px; background-image: url(00070104); padding-bottom: 3px; padding-top: 3px; font-family: tahoma"></HeaderStyleActive>
<contentstyleactive csstext="border-top: #335c88 1px solid; background-color: #e5f1fd"></contentstyleactive>
<footerstyleactive csstext="border-right: #22456a 1px solid; background-image: url(00070104); padding-right: 4px; border-top: #7d97b6 1px solid; padding-left: 4px; border-left-width: 1px; font-size: 11px; border-left-color: #728eb8; padding-bottom: 4px; color: white; padding-top: 4px; border-bottom: #22456a 1px solid; font-family: verdana"></FooterStyleActive>
<FooterTemplate >
<asp:Button ID="Button1" runat="server" Text="Close" />
</FooterTemplate>
</eo:dialog>
</center>
</eo:CallbackPanel>
<eo:Dialog runat="server" id="dlgProcessing" BackColor="white" BorderWidth="1" BackShadeColor="Blue" ShadowColor="LightGray" BorderColor="#335C88" ShadowDepth="3" >
<ContentTemplate>
<table border="0" width="250">
<tr>
<td align="center">
<img src="<%= ResolveUrl("Images/indicator.gif") %>" />
</td>
</tr>
<tr>
<td align="center"><b>Please wait...</b></td>
</tr>
</table>
</ContentTemplate>
</eo:Dialog>
</form>
</body>
</html>
IN TEST1.VB
Partial Class Test1
Inherits System.Web.UI.Page
Protected Sub ddltest1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddltest1.SelectedIndexChanged
If ddltest1.SelectedItem.Text <> "--Select--" Then
ddltest2.Items.Clear()
ddltest2.Enabled = True
If ddltest1.SelectedItem.Text = "Cars" Then
ddltest2.Items.Insert(0, "BMW")
ddltest2.Items.Insert(1, "Ford")
ddltest2.Items.Insert(2, "Innova")
Else
ddltest2.Items.Insert(0, "CBZ")
ddltest2.Items.Insert(1, "Pulsar")
ddltest2.Items.Insert(2, "Karizna")
End If
Else
ddltest2.Items.Clear()
ddltest2.Enabled = False
End If
End Sub
NOTE:
To raise an event in eo:call back Panel Use the Execute event.
From above Example the event should raise as follows:
'Protected Sub cbpTargetTable_Execute(ByVal sender As Object, ByVal e As EO.Web.CallbackEventArgs) Handles cbpTargetTable.Execute
' If e.TriggerControlID = "ddlTest1" Then
' Your Code
' End If
'End Sub
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment