Capitolo 10 tutto su ObjectDataSource

Cristian Civera

di Cristian Civera, in .NET 2.0, martedì 6 giugno 2006 ore 23.19

O quasi... E' l'argomento principe poiché ormai tutti sappiamo che il miglior approccio all'accesso ai dati è interfacciarsi con le classi business.
L'intero capitolo credo che abbia abbastanza un approccio pratico, basato su esigenze che si possono incontrare, come le master/details e dò spazio anche ad un DataControlFied personalizzato.

Purtroppo non ha trovato spazio alla creazione di un DataSource personalizzato. E' piuttosto lungo da spiegare in effetti e soprattutto non è una cosa da tutti i giorni.
Il problema è che mi sono preso così bene che ho sviluppato un FileSystemDataSource, per l'accesso al file system, e un FtpDataSource, per l'accesso ad un host FTP. Entrambi che implementano sia IDataSource che IHierarchicalDataSource e quindi utilizzabili sia con TreeView/Menu, sia con GridView e fratelli.

Probabilmente li lascerò comunque nel codice che daremo insieme al libro.

Il loro utilizzo è alquanto semplice

<aspitalia:FtpDataSource ID="ftp1" runat="server" UsePassive="true" Host="ftp://localhost" /><p /><asp:TreeView ID="treeView1" runat="server" DataSourceID="ftp1"> 
    <DataBindings> 
        <asp:TreeNodeBinding DataMember="Directory" TextField="Name" ImageUrl="~/Images/folder.gif" /> 
        <asp:TreeNodeBinding DataMember="File" TextField="Name" ImageUrl="~/Images/file.gif" /> 
    </DataBindings> 
</asp:TreeView>

FtpDataSource

Commenti

Per inserire un commento, devi avere un account.

Fai il login e torna a questa pagina, oppure registrati alla nostra community.



Segnala su: Facebook MSDN Social Twitter Segnalo Wikio Diggita Technorati Stumbleupon Google Yahoo FriendFeed Delicious Furl

Nella stessa categoria
I più letti del mese
TagCloud
.NET Framework, .NET Framework 2.0, .NET Framework 3.0, .NET Framework 3.5, .NET Framework 4.0, ADO.NET Entity Framework, AJAX, Architettura, ASP, ASP.NET, ASP.NET 2.0, ASP.NET 2.0 per tutti, ASP.NET 4.0, ASPItalia.com, Custom Control, Databinding, Datagrid, HttpRuntime, IIS, Javascript, LINQ, LINQ to Entities, LINQ to SQL, Media Center, Microsoft Expression, Object Oriented Programming, Off Topic, PDC 2008, Silverlight, Silverlight - animazioni, Silverlight 2.0, Silverlight 3.0, User Control, Visual Studio, Windows 7, Windows CardSpace, Windows Client, Windows Communication Foundation, Windows Live Services, Windows Presentation Foundation, Windows Server, Windows Vista, Windows Workflow Foundation, XAML, XBox 360, XHTML, XML, XPS, XSLT
BLOG INFO
  • 199 post, 86 commenti, 42 trackback
  • Feed blog e contenuti tecnici: RSS
  • Feed blog: RSS Atom
IN EVIDENZA