Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Asp:Repeater

  1. #1

    Asp:Repeater

    Ho un problema con l'elemento <asp:Repeater>

    Praticamente io con una query riempio un dataset e poi utilizzo questo codice per popolare una tabella:

    codice:
    <asp:Repeater ID="accessiWeb" Runat="server">
    				<HeaderTemplate>
    				<table border="1" width="200" align="center">
    					<tr>
    						<td width="100">
    							Codice cliente
    						</td>
    						<td width="100">
    							Account
    						</td>
    					</tr>
    				</HeaderTemplate>
    
    				<ItemTemplate>
    					<%
    					dim valore AS string
    					valore = DataBinder.Eval(Container.DataItem, "CODCLI")
    					
    					if valore = "BILWEB02" then
    					%>
    					<tr>
    						<td width="100">
    							<%#DataBinder.Eval(Container.DataItem, "CODCLI")%>
    						</td>
    						<td width="100">
    							<%#DataBinder.Eval(Container.DataItem, "ACCOUNT")%>
    						</td>
    					</tr>
    					<%end if%>
    				</ItemTemplate>
    
    				<FooterTemplate>
    				</table>
    				</FooterTemplate>
    			</asp:Repeater>
    Ma quando cerco di riempire la variabile valore per visualizzare solo i record che sono uguali a BILWEB02 mi da errore:

    valore = DataBinder.Eval(Container.DataItem, "CODCLI")

    codice:
    Compiler Error Message: BC30451: Name 'Container' is not declared.
    
    Source Error:
    
     
    
    Line 123:					<%
    Line 124:					dim valore AS string
    Line 125:					valore = DataBinder.Eval(Container.DataItem, "CODCLI")
    Line 126:					
    Line 127:					if valore = "BILWEB02" then
    Chi mi aiuta perfavore???
    Spago

    [Officials Sites]
    http://www.hobbybirra.it/spaghetto/

  2. #2
    Utente di HTML.it
    Registrato dal
    Aug 2001
    Messaggi
    1,482
    Non fai prima a modificare la query, o ad utilizzare un DataView?

    Hey hey, my my Rock and roll can never die!

  3. #3
    E come si utilizza Dataview ???
    Spago

    [Officials Sites]
    http://www.hobbybirra.it/spaghetto/

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.