Reference Control in a Separate Content area.

  • Thread starter Thread starter Gaidheil
  • Start date Start date
G

Gaidheil

VS 2008 SP1 3.5 Framework

I have a MasterPage with two ContentPlaceholders. I am using one as a
DashBoard area with controls like ComboBoxes etc for filtering. the other
area is my main content. Like a ListView.

I am using an UpdatePanel and trying to add a trigger from a control in the
dashboard. but when I run my page, it cannot find the control.

Snipit below ( structure only)

<%@ Page Title="" Language="C#" MasterPageFile="~/TaskBoard.master"
AutoEventWireup="true"
CodeFile="manageProjects.aspx.cs" Inherits="employee_manageProjects" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphDashboard" runat="Server">

<asp:DropDownList ID="DropDownList1" runat="server"

onselectedindexchanged="DropDownList1_SelectedIndexChanged"
AutoPostBack="True">
<asp:ListItem Selected="True" Value="%">All</asp:ListItem>
<asp:ListItem>In Progress</asp:ListItem>
</asp:DropDownList>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" runat="Server">

.....

<asp:UpdatePanel ID="updatePanelProjects" runat="server"
UpdateMode="Conditional">
<ContentTemplate>
<asp:ListView ID="lvProjects" runat="server"
DataSourceID="odsProjects"
.....
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1" />
</Triggers>
</asp:UpdatePanel>

.....

</asp:Content>
 
thats becuase they are in different naming containers. you will have to
set trigger controlid in codebehind, and use DropDownList1.UniqueID

-- bruce (sqlwork.com)
 
Thanks Bruce!

I ended up having to add the Triggers inthe Page_Init() using as you stated
the Control.UniqueID
 
Back
Top