Reference Control in a Separate Content area.

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>
 
B

bruce barker

thats becuase they are in different naming containers. you will have to
set trigger controlid in codebehind, and use DropDownList1.UniqueID

-- bruce (sqlwork.com)
 
G

Gaidheil

Thanks Bruce!

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,698
Latest member
LydiaHalle

Latest Threads

Top