Home All Groups Group Topic Archive Search About

Interactivity between placeholders & objectdatasouces

Author
21 Jun 2006 5:37 AM
TTT
Hello,

1) This code don't work, may some of you explain why?
<asp:Content ContentPlaceHolderID="AAA">
<asp:TextBox ID="QueryTextBox" />
</asp:Content>

<asp:Content ContentPlaceHolderID="BBB">
<asp:ObjectDataSource ID="AdsDataSource" SelectMethod="GetAdsByQuery">
<SelectParameters>
<asp:ControlParameter ControlID="QueryTextBox" Name="searchTerm"
PropertyName="Text" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</asp:Content>

Error = cannot find the control QueryTextBox in the parameter "searchTerm".
Why?
It seems that ContentPlaceHolders cannot see their content?

2) Cascade of queries with ObjectDatasources
I would like to execute 2 queries in this order :
- Select Title, AdId, Description, ... From Ads where [some condition]
And then :
- Select Bytes From Photos where AdId = [AdId found in the first query]

How can i do it ? with 2 ObjectDatasources? But they are dependent, how to
excute them in the right order? how would you write it?

THANKS A LOT

Author
21 Jun 2006 2:57 PM
Brock Allen
Mark the QueryTextBox with runat=server

-Brock
http://staff.develop.com/ballen


Show quoteHide quote
> Hello,
>
> 1) This code don't work, may some of you explain why?
> <asp:Content ContentPlaceHolderID="AAA">
> <asp:TextBox ID="QueryTextBox" />
> </asp:Content>
> <asp:Content ContentPlaceHolderID="BBB">
> <asp:ObjectDataSource ID="AdsDataSource" SelectMethod="GetAdsByQuery">
> <SelectParameters>
> <asp:ControlParameter ControlID="QueryTextBox" Name="searchTerm"
> PropertyName="Text" Type="String" />
> </SelectParameters>
> </asp:ObjectDataSource>
> </asp:Content>
> Error = cannot find the control QueryTextBox in the parameter
> "searchTerm".
> Why?
> It seems that ContentPlaceHolders cannot see their content?
> 2) Cascade of queries with ObjectDatasources
> I would like to execute 2 queries in this order :
> - Select Title, AdId, Description, ... From Ads where [some condition]
> And then :
> - Select Bytes From Photos where AdId = [AdId found in the first
> query]
> How can i do it ? with 2 ObjectDatasources? But they are dependent,
> how to excute them in the right order? how would you write it?
>
> THANKS A LOT
>