471,595 Members | 1,092 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,595 software developers and data experts.

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

2
Please tell me how to call a (.cs) file in c# application.please 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.
Jul 5 '07 #1
2 11255
dip_developer
648 Expert 512MB
Please tell me how to call a (.cs) file in c# application.please 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...???

Expand|Select|Wrap|Line Numbers
  1.  ' Suppose your class name is clsCustomer 
  2. Dim ObjclsCustomer As New clsCustomer
  3. 'now call a method like this
  4. ObjclsCustomer.GetCustomerDetail()
  5.  
Jul 5 '07 #2
Spanco
13
Please tell me how to call a (.cs) file in c# application.please 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.functionname(function parameter)


End

U have done it ,any prom shoot me a reply
Jul 5 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Ethics | last post: by
13 posts views Thread by Bijoy Naick | last post: by
3 posts views Thread by Colin \(615498\) | last post: by
5 posts views Thread by Kuldeep | last post: by
1 post views Thread by shakthi | last post: by
2 posts views Thread by Reggie | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.