Si! hai ragione... infatti ci sono ricaduta!
Sfrutto questo 3d visto che l'errore che mi viene restituito è lo stesso, la causa non so...
ho questa label:
codice:
<asp:Label id="Label1" runat="server"><%#StrTesto2((string)DataBinder.Eval(Container.DataItem, "Giorno"))%></asp:Label>
La funzione StrTesto2 è questa:
codice:
protected string StrTesto2(string testo)
{
if (testo =="")
return "";
else
{
string pippo = testo + "/";
return pippo;
}
}
Vorrei quindi che: Se giorno è null mettesse uno spazio, se non è null mettesse il numero e uno slash.
Errore:
codice:
Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Specified cast is not valid.
Source Error:
Line 84:<TD class="cella1">
Line 85:<asp:Label id="Label1" runat="server">
Line 86:<%#StrTesto2((string)DataBinder.Eval(Container.DataItem, "Giorno"))%>
Line 87:</asp:Label>
Line 88:
Sonia