Hi there,
Here's what you can do:
1. In the MasterPage, create a property called SelectCommand of type String.
2. In the Setter and Getter of this property get the command text from the underlying SqlCommand SqlDataSource control.
3. On your content page, add a MasterType directive like this:
<%@ MasterType VirtualPath="~/MasterPage.master" %>
Just add this to the top of the page, right below the Page directive and make sure it points to the correct master page.
4. The Code Behind has now strongly typed access to the master, so you can do something like this:
this.Master.SelectCommand = "Bla Bla Bla";
Hope this helps,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of
ASP.NET 2.0 Instant Results and
Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.