Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
ASP.NET 2.0 / 3.5 / 4.0
Gid to String
martedì 25 aprile 2006 - 05.01
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
aabruzzese
Profilo
| Junior Member
89
messaggi | Data Invio:
mar 25 apr 2006 - 05:01
Sto cercando una soluzione a questo problema:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30311: Value of type 'System.Guid' cannot be converted to 'String'.
Source Error:
Line 348: <asp:TemplateField SortExpression="avatar">
Line 349:<ItemTemplate>
Line 350:<asp:Image ID="Image1" runat="server" ImageUrl='<%# "AvatarImagefetch.ashx?UserName=" & CStr(new Guid(Eval("UserID").ToString()))) %>'/>
Line 351:</ItemTemplate>
Line 352:
Per mandare un GUID ad un altra pagina ma come una STRING e non un GUID.
USERID e una colonna di typo GUID.
Angelo Abruzzese
Brainkiller
Profilo
| Guru
7.999
messaggi | Data Invio:
mar 25 apr 2006 - 09:43
>Per mandare un GUID ad un altra pagina ma come una STRING e non
>un GUID.
>USERID e una colonna di typo GUID.
Perchè devi creare una nuova istanza di una struttura Guid ?
Non puoi provare a mettere semplicemente Eval("UserID").ToString() ?
Ciao
David De Giacomi
Microsoft MVP
http://blogs.dotnethell.it/david/
aabruzzese
Profilo
| Junior Member
89
messaggi | Data Invio:
mar 25 apr 2006 - 14:54
Ciao David,
Cercando o trovato :
<ItemTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# "AvatarImagefetch.ashx?MemberId=" & DataBinder.Eval(Container.DataItem,"UserId").ToString %>'/>
</ItemTemplate>
inveci di :
CStr(Eval("UserID").ToString)
con che ti risulta un Errore : Value of type 'System.Guid' cannot be converted to 'String'
Ancora meglio:
<%# String.Concat("AvatarImagefetch.ashx?MemberId=", Eval("UserID")) %>
String.Concat can accept an object and will automatically convert it to a string
Angelo Abruzzese
Torna su
Stanze Forum
Elenco Threads
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 !