Errore: Operator '==' cannot be applied to operands of type 'method group' and 'string'

Con risposta Errore: Operator '==' cannot be applied to operands of type 'method group' and 'string'

  • mercoledì 11 aprile 2012 08:42
     
      Contiene codice

    Ciao a tutti, avrei necessità del vostro prezioso aiuto.

    In un codice net dovrei disabilitare un' istruzione "hyperlink" quando il valore del campo "myState" che la precede è diverso da "validate".

    Ho scritto così ma la pagina risponde con un errore.

    Cosa sbaglio?

    Grazie tante in anticipo per l'interessamento.

    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Link") %>' Text='<%# Eval("Link") %>'
    
        Enabled='<%# Eval("myState").ToString == "validate" %>'/> 
    
    
    
    
    
    Server Error in '/localhost' Application.
    --------------------------------------------------------------------------------
    
    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: CS0019: Operator '==' cannot be applied to operands of type 'method group' and 'string'
    
    Source Error:
    
     
    
    Line 186:    <ItemTemplate>
    Line 187:      <asp:Panel ID="Panel3" Runat="Server">
    Line 188:        <asp:HyperLink ID="HyperLink1" runat="server" 
    Line 189:                       NavigateUrl='<%# Eval("Link") %>' 
    Line 190:                       Text='<%# Eval("Link") %>'  


    • Modificato cms9651 mercoledì 11 aprile 2012 08:44
    •  

Tutte le risposte