Jump to content

Namespace Problem


siri

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...