siri Posted July 10, 2008 Share Posted July 10, 2008 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 More sharing options...
jesh Posted July 10, 2008 Share Posted July 10, 2008 I having a namepsace in the App_Code file as follows:Namespace MyDataPublic clas ABCEnd ClassEnd NamespaceMaybe 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.