PC Review


Reply
Thread Tools Rate Thread

Access Masterpage SQLDatasource

 
 
Gaspar
Guest
Posts: n/a
 
      21st Aug 2008
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!


 
Reply With Quote
 
 
 
 
Jonathan Wood
Guest
Posts: n/a
 
      21st Aug 2008
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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!
>


 
Reply With Quote
 
matrixgoh
Guest
Posts: n/a
 
      23rd Aug 2008
Why not cache your data?
Hope this will help.

MatrixGoh

"Jonathan Wood" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>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!
>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing a control on a masterpage that uses a second masterpage Torben Laursen Microsoft ASP .NET 4 15th Mar 2008 03:27 AM
MasterPages - take plain form, add MasterPage. MasterPage does NOT appear when run Randy Smith Microsoft ASP .NET 8 14th Apr 2007 10:06 AM
Access MasterPage component =?ISO-8859-1?Q?Mika=EBl_PLOUHINEC?= Microsoft ASP .NET 5 30th Oct 2006 08:49 AM
MasterPage -> Page -> MasterPage Code Access =?Utf-8?B?QWxleCBNYWdoZW4=?= Microsoft ASP .NET 3 14th Apr 2006 01:34 PM
Access Properties from Masterpage Tony Microsoft ASP .NET 0 2nd Nov 2004 12:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:43 PM.