Jump to content

Namespace Problem


siri
 Share

Recommended Posts

Hi,I having a namepsace in the App_Code file as follows:Namespace MyDataPublic clas ABCEnd ClassEnd NamespaceWhen I try to use this class in the aspx page, I imported the namespace in the code-behind asImports MyDataNow say in the page load event I try to create the object of the class I am not getting the class name directlyInstead the intellisense displays the Namespace MYData i.e I am able to create the object in the following manner:***********************************************Imports MyDatasub Page_Loaddim obj as new mydata.ABC ' Instead of this I want to do in the following mannerdim obj as new ABCEnd sub*************************************************

Link to comment
Share on other sites

I having a namepsace in the App_Code file as follows:Namespace MyDataPublic clas ABCEnd ClassEnd Namespace
Maybe that's just a typo, but shouldn't that be more like this:
Namespace MyDataPublic Class ABCEnd ClassEnd Namespace

Also, I'm not sure about VB, but in C#, you need to specify constructors or else you can't create an instance of that class:

namespace MyData{	public class ABC	{		public ABC()		{		}	}}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...