Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Access Masterpage SQLDatasource

0 views
Skip to first unread message

Gaspar

unread,
Aug 21, 2008, 2:13:28 PM8/21/08
to
I have a MasterPage with a SqlDatSource named "myDS".
In a content page placed inside a ContentPlaceHolder I have a GridView that
I need to connect to myDS.

The problem is that "myDS" is not listed in the GridView's "Choose Data
Source" list. If I force it to "myDS", I can access the data in runtime
(i.e. the page runs OK), but the designer doesn't show the columns, data,
etc., to design the GridView.

Any ideas?
Thanks!


Jonathan Wood

unread,
Aug 21, 2008, 2:23:43 PM8/21/08
to
I don't know a simple solution. If I had to do this, I'd expose a property
in the master page that returns the data source. You could then reference
the Master property and type cast it to your master page in your content
page's Load event and set the GridView's data source.

Beyond that, it's hard for me to think of a case where it makes sense to put
a datasource in the master page unless the data is also being displayed from
the master page. FWIW, I wouldn't think twice about duplicating a data
source on different pages if I needed the same data on both pages.

Don't know if that's any help though.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com


"Gaspar" <nor...@nospamplease.com> wrote in message
news:eQCddm7A...@TK2MSFTNGP03.phx.gbl...

matrixgoh

unread,
Aug 23, 2008, 6:24:25 AM8/23/08
to
Why not cache your data?
Hope this will help.

MatrixGoh

"Jonathan Wood" <jw...@softcircuits.com> wrote in message
news:eILmRs7A...@TK2MSFTNGP06.phx.gbl...

0 new messages