Reference Control in a Separate Content area.

Discussion in 'ASP .Net' started by Gaidheil, Mar 31, 2009.

  1. Gaidheil

    Gaidheil Guest

    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>
    Gaidheil, Mar 31, 2009
    #1
    1. Advertising

  2. Gaidheil

    bruce barker Guest

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

    -- bruce (sqlwork.com)

    Gaidheil wrote:
    > 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>
    >
    bruce barker, Apr 1, 2009
    #2
    1. Advertising

  3. Gaidheil

    Gaidheil Guest

    Thanks Bruce!

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



    "bruce barker" wrote:

    >
    > thats becuase they are in different naming containers. you will have to
    > set trigger controlid in codebehind, and use DropDownList1.UniqueID
    >
    > -- bruce (sqlwork.com)
    >
    > Gaidheil wrote:
    > > 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>
    > >

    >
    Gaidheil, Apr 1, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. EvgueniB
    Replies:
    1
    Views:
    621
    Anthony Borla
    Dec 15, 2003
  2. Mark
    Replies:
    1
    Views:
    588
    Larry Barowski
    Jun 27, 2005
  3. Frank Fredstone
    Replies:
    1
    Views:
    435
    Jean-Francois Briere
    Jun 27, 2006
  4. hotadvice
    Replies:
    14
    Views:
    700
    hotadvice
    Oct 2, 2007
  5. Andy B.
    Replies:
    0
    Views:
    801
    Andy B.
    Apr 30, 2010
Loading...

Share This Page