instance problem
-
how to create instance of a class which is inside a app_code folder's folder. means my file is like below App_code -myfolder class2.vb Inside folder which is placed inside app_code folder. i want to create class2 instance in my vb file. if it is inside app_code,normalo decalration is dim ptr as class2=new class2 but class2 is inside myfolder. please give me some idea
kissy
-
how to create instance of a class which is inside a app_code folder's folder. means my file is like below App_code -myfolder class2.vb Inside folder which is placed inside app_code folder. i want to create class2 instance in my vb file. if it is inside app_code,normalo decalration is dim ptr as class2=new class2 but class2 is inside myfolder. please give me some idea
kissy
Kissy16 wrote:
how to create instance of a class which is inside a app_code folder's folder
It doesn't matter where your class file reside. The only important aspects are the class name(usually when it is in a Folder, Visual Studio puts the name as FolderName_ClassName), the access modifier.
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
Kissy16 wrote:
how to create instance of a class which is inside a app_code folder's folder
It doesn't matter where your class file reside. The only important aspects are the class name(usually when it is in a Folder, Visual Studio puts the name as FolderName_ClassName), the access modifier.
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
thanks for ur response. actually am using c# and vb files in my vb.net project. for c# files am using another folder and placed the c# files inside it. and added the subdirectories tag in web.config. as my project is vb how can i access the c# class inside my .vb file? please five me some example
kissy
-
thanks for ur response. actually am using c# and vb files in my vb.net project. for c# files am using another folder and placed the c# files inside it. and added the subdirectories tag in web.config. as my project is vb how can i access the c# class inside my .vb file? please five me some example
kissy
What is the problem ? It doesn't matter. I don't believe you can use VB and C# files in your project, you can only mix them up for the pages. But, if it compiles, then I am wrong. Either way, the classes in the project, are visible to all languages in the project. Did you actually try anything before asking this ? Is so, and it doesn't work, post the code and the error so we can try to work out what you're doing wrong.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
-
thanks for ur response. actually am using c# and vb files in my vb.net project. for c# files am using another folder and placed the c# files inside it. and added the subdirectories tag in web.config. as my project is vb how can i access the c# class inside my .vb file? please five me some example
kissy
Does it compile properly after putting the C# and VB Class in different folder? Did you set the web.config Subdirectory Section like <Compilation> <codeSubDirectory> .... <add directoryName="CSharpFolderName"/> ..... </codeSubDirectories> </compilation> Then try to access the call method using object that class. Also check the class access modifier.
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article
-
What is the problem ? It doesn't matter. I don't believe you can use VB and C# files in your project, you can only mix them up for the pages. But, if it compiles, then I am wrong. Either way, the classes in the project, are visible to all languages in the project. Did you actually try anything before asking this ? Is so, and it doesn't work, post the code and the error so we can try to work out what you're doing wrong.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
am trying to use .cs class file in my vb.net project. I read that in vs2005 ,it compiles the multiple languages. and now in my app_code folder i have added some of my .vb classes and for c# classes i have added folder and inside i placed my c# files. i have added the following tag in my web.config When am just compiling it is giving error ,identifier expected in the below line <%@ Page Language="VB" AutoEventWireup="false" codeFile="Default3.aspx.vb" Inherits="Default3" %> and i wanted to create instance of that .cs class and want to use in my .vb.aspx file. Can it be possible,ya am i interpreting wrongly? please send me what i have to do in this case? please if u have time......
kissy
-
Does it compile properly after putting the C# and VB Class in different folder? Did you set the web.config Subdirectory Section like <Compilation> <codeSubDirectory> .... <add directoryName="CSharpFolderName"/> ..... </codeSubDirectories> </compilation> Then try to access the call method using object that class. Also check the class access modifier.
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article
while building itseldf it is showing the error like "identifier expected" in the following line.. <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %> ya i have added the same in my web.config file. there is no intellisence coming with my .cs class file.
kissy