Array come sorgente

giovedì 22 febbraio 2007 - 11.02

Gemini Profilo | Expert

Ciao a tutti
ho definito una struct:

private struct strCamera
{
public string Camera;
public string PostiLetto;
public string Descrizione;
public string Note;
public string strBigImage;
public string strPreload;
public string strSmallImage1;
public string strSmallImage2;
public string strSmallImage3;
public string strSmallImage4;
public string strSmallImage5;

private strCamera(string Camera,string PostiLetto,string Descrizione,string Note,string strBigImage,string strPreload,string strSmallImage1,string strSmallImage2,string strSmallImage3,string strSmallImage4,string strSmallImage5)
{
this.Camera = Camera;
this.PostiLetto = PostiLetto;
this.Descrizione = Descrizione;
this.Note = Note;
this.strBigImage = strBigImage;
this.strPreload = strPreload;
this.strSmallImage1 = strSmallImage1;
this.strSmallImage2 = strSmallImage2;
this.strSmallImage3 = strSmallImage3;
this.strSmallImage4 = strSmallImage4;
this.strSmallImage5 = strSmallImage5; }
}

ho definito un vettore:
strCamera[] Camere;

dopo aver inserito i dati nel vettore l'ho assegnato ad un repeater:
rptCamere.DataSource = Camere;
rptCamere.DataBind();

Però quando vado a visualizzare i dati ho un errore:
<%# DataBinder.Eval(Container, "DataItem.strSmallImage1") %>

errore:
Dettagli eccezione: System.Web.HttpException: DataBinder.Eval: 'Mio Sito.main.hotel_camere+strCamera' non contiene una proprietà con nome strSmallImage1

Dove sbaglio?
Grazie
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5