Object reference across asp:Content boundary

G

Gary

I have an asp.net 3.5 aspx page that references a site.master file with 3
asp:contentplaceholder sections in it. The main content section contains an
asp:repeater control and it's associated asp:ObjectDataSource. I'd like the
asp:Objectdatasource to be able to reference filter criteria controls in one
of the other asp:content sections.

Is this possible, or do I need to put the control results into the viewstate
and get them from there? Code snippet below reports error that "FilterHeld"
control doesn't exist:

<%@ Page Language="VB" MasterPageFile="~/Site.master" %>
<asp:Content ID="Nav" ContentPlaceHolderID="NavBottom" runat="server">
<asp:CheckBox ID="FilterHeld" runat="server" AutoPostBack="True"
EnableViewState="True" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:ObjectDataSource ID="ObjDS" runat="server"
SelectMethod="GetBLLJobs" TypeName="spJobsBLL">
<SelectParameters>
<asp:ControlParameter ControlID="FilterHeld" DefaultValue="False"
Name="Hold" PropertyName="Checked" Type="Boolean" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:Repeater ID="Rpt1" runat="server" DataSourceID="ObjDS">
<ItemTemplate>
<%#Eval("BatchID")%><br />
</ItemTemplate>
</asp:Repeater>
</asp:Content>
 
B

Bob Barrows

Gary said:
I have an asp.net 3.5 aspx page

There was no way for you to know it (except maybe by browsing through
some of the previous questions before posting yours - always a
recommended practice), but this is a classic (COM-based) asp newsgroup.
ASP.Net is a different technology from classic ASP. While you may be
lucky enough to find a dotnet-savvy person here who can answer your
question, you can eliminate the luck factor by posting your question to
a newsgroup where the dotnet-savvy people hang out. I suggest

microsoft.public.dotnet.framework.aspnet.

There are also forums at www.asp.net where you can find a lot of people
to help you.
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top