CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • CS0118: 'GetName' is a 'variable' but is used like a 'method'

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    6256
  • Date Created
    Friday, June 17, 2022
  • Last Updated
    Friday, June 17, 2022
  • This Article Has been Viewed
    499 times
  • Short Desc
    What causes my C# code to throw the variable is used like a method?
  • Details
    In C# you need to wrap your Variables with brackets [v] not with parenthesis () like in VB.NET.
  • Recreate Issue
    This is caused when you wrap a variable with parenthesis in C# language.

    (Ignore the open and closing brackets in these examples)
    <%
    Response.Write(getFile + "(" + GetName(v) + ") Uploaded Successfully!<br />");
    %>
  • Resolve Issue
    Replace the (v) with [v]
    <%
    Response.Write(getFile + "(" + GetName[v] + ") Uploaded Successfully!<br />");
    %>