how to refer or call a class file in c# application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rojiin
    New Member
    • Jul 2007
    • 2

    how to refer or call a class file in c# application

    Please tell me how to call a (.cs) file in c# application.ple ase provide me with an example.as i am trying to import that class file but i don 't know how to call it in my code behind file.please help me.
  • dip_developer
    Recognized Expert Contributor
    • Aug 2006
    • 648

    #2
    Originally posted by rojiin
    Please tell me how to call a (.cs) file in c# application.ple ase provide me with an example.as i am trying to import that class file but i don 't know how to call it in my code behind file.please help me.
    you have that .cs file in your project...?? then simply create an object of that class and call its methods or properties or functions.What' s your actual problem...???

    [CODE=vbnet] ' Suppose your class name is clsCustomer
    Dim ObjclsCustomer As New clsCustomer
    'now call a method like this
    ObjclsCustomer. GetCustomerDeta il()
    [/CODE]

    Comment

    • Spanco
      New Member
      • Mar 2007
      • 13

      #3
      Originally posted by rojiin
      Please tell me how to call a (.cs) file in c# application.ple ase provide me with an example.as i am trying to import that class file but i don 't know how to call it in my code behind file.please help me.
      Step 1 .Create a .cs file (Hope u didnt get any problem)
      Let us suppose that u create UtilityInfo.cs and add it to app Code folder

      Step2.

      At ur Page load event Create the instance of ur .cs file as
      UtilityInfo utf =new UtilityInfo();

      Step 3.

      If u want to call any function from that cs file u just to write

      utf.functionnam e(function parameter)


      End

      U have done it ,any prom shoot me a reply

      Comment

      Working...