Ben,
Yes, all of the controls that trigger an update are inside the same update panel. Here is my code:
1 <atlas:UpdatePanel ID="SearchUpdate" runat="server">
2 <ContentTemplate >
3 <asp:Panel runat ="server" ID="tblSearch" Height ="40px">
4 <table cellpadding="0" cellspacing="0" style="font-size: xx-small;
5 vertical-align: middle; font-family: verdana; height: 40px; background-color: #deeaf3;
6 text-align: right">
7 <tr style="height:45px;">
8 <td style="width: 100px; height: 40px">
9 <asp:RadioButtonList ID="RecordSelectList" runat="server" style="font:verdana; font-size :xx-small; font-weight:bold ;" AutoPostBack ="true" OnSelectedIndexChanged="RecordSelectList_SelectedIndexChanged" >
10 <asp:ListItem Selected="True" Value="1">Contact</asp:ListItem>
11 <asp:ListItem Value="2">Company</asp:ListItem>
12 </asp:RadioButtonList></td>
13 <td style="width: 100px; height: 40px; vertical-align:middle;">
14 <asp:DropDownList ID="ddlSearchFields"
15 runat="server" Width="155px" style="font :verdana; font-size :xx-small;" AutoPostBack="True" EnableViewState ="true" OnSelectedIndexChanged="ddlSearchFields_SelectedIndexChanged">
16 </asp:DropDownList><br />
17 <asp:Panel ID="ddlPanel" runat="server" Visible="False" Width="125px" Direction="LeftToRight">
18 <asp:DropDownList ID="ddlCriteria" runat="server" Font-Size="XX-Small" EnableViewState ="true"
19 Width="155px">
20 </asp:DropDownList></asp:Panel>
21 <asp:Panel ID="txtPanel" runat="server" Width="125px">
22 <asp:TextBox ID="txtSearchStr" runat="server" style="font :verdana; font-size :xx-small; width:155px;" EnableViewState ="true" ></asp:TextBox><cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="txtSearchStr" WatermarkText="Enter Search Criteria">
23 </cc1:TextBoxWatermarkExtender>
24 </asp:Panel>
25 </td>
26 <td style="width: 100px; height: 40px; vertical-align :middle; padding-right: 3px; padding-left: 3px;" >
27
28 <asp:ImageButton ID="btnQuickSearch" runat="server" ImageUrl="~/Images/QuickSearch.jpg" OnClick="btnQuickSearch_Click" /></td></tr> </table>
29 <cc1:roundedcornersextender id="RoundedCornersExtender1" runat="server" targetcontrolid="tblSearch" Radius="2" Corners="All" Enabled="true" Color="222, 234, 249" ></cc1:roundedcornersextender>
30 </asp:Panel>
31 </ContentTemplate>
32 </atlas:UpdatePanel>
And in my code behind:
1 Protected Sub RecordSelectList_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
2
3 Dim SearchFieldsSet As New Data.DataSet
4 Dim SearchFieldsAdapter As New Data.SqlClient.SqlDataAdapter("SELECT FieldName, FieldValue FROM tblSearchFields WHERE RecordTypeID = @RecordTypeID ORDER BY FieldName", [Data Source])
5 Dim Param1 As New Data.SqlClient.SqlParameter
6
7 Param1 = SearchFieldsAdapter.SelectCommand.Parameters.Add("@RecordTypeID", Data.SqlDbType.NVarChar)
8 Param1.SqlValue = Me.RecordSelectList.SelectedValue
9
10 SearchFieldsAdapter.Fill(SearchFieldsSet)
11
12 Me.ddlSearchFields.DataSource = SearchFieldsSet.Tables(0)
13 Me.ddlSearchFields.DataTextField = SearchFieldsSet.Tables(0).Columns("FieldName").ColumnName.ToString()
14 Me.ddlSearchFields.DataValueField = SearchFieldsSet.Tables(0).Columns("FieldValue").ColumnName.ToString()
15 Me.ddlSearchFields.DataBind()
16
17 SearchFieldsSet.Clear()
18 SearchFieldsAdapter.Dispose()
19
20 End Sub
1 Protected Sub ddlSearchFields_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
2
3 Dim ds As Data.DataSet
4 Dim tbl() As String = Split(Trim(Me.ddlSearchFields.SelectedValue), ".")
5
6 ReDim param(0)
7 ReDim paramtype(0)
8 ReDim paramval(0)
9
10 param(0) = "@TableName"
11 paramtype(0) = 16 '"dbtype.string"
12 paramval(0) = tbl(1)
13
14 ds = bind.GetDataSet("PopulateDDLs", param, paramtype, paramval)
15
16 Me.ddlCriteria.DataSource = ds.Tables(0)
17 Me.ddlCriteria.DataTextField = ds.Tables(0).Columns(tbl(1)).ColumnName.ToString()
18 Me.ddlCriteria.DataValueField = ds.Tables(0).Columns(tbl(1) & "ID").ColumnName.ToString()
19
20 Me.ddlCriteria.DataBind()
21
22 ds.Clear()
23 ds.Dispose()
24
25 Me.ddlPanel.Visible = True
26 Me.txtPanel.Visible = False
27
28 End Sub
I hope that helps. Thank you in advance!