Results 1 to 7 of 7

Thread: Visual Basic . Net Component in Asp.Net

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    58

    Visual Basic . Net Component in Asp.Net

    Hi All

    I have Component desiged using Visual baisc .net (2003) called "PigaDeal" which has two calsses "RegisterUsers" and "Savedata" which i am using to save user Information like name,address,city and so on, "RegisterUser" for Implementing Business logic where as "SavaData" is to Save Data in the Sql server.

    When im using these components with windows form for the testing it works perfectly but when i am using these component in the ASP. Net its giving me the following error. I have imported the component by writing the following line and even i have build the component with the rootnamespace "pigadeal"

    <%@ import namespace="PigaDeal" %>

    Compiler Error Message: BC30002: Type 'RegisterUser' is not defined.

    Source Error:

    Line 10: dim myBizObject as new RegisterUser
    Line 11: myBizObject.Title=lstTitle.text
    Line 12: myBizObject.FirstName=txtFirstName.text

    What mistake im doing ?

    Thanks
    Ajay

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,484

    Re: Visual Basic . Net Component in Asp.Net

    Have you added a reference to the library that contains your component?

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    58

    Re: Visual Basic . Net Component in Asp.Net

    Hi

    How to do that? Sorry if im asking silly question

    Thanks

  4. #4
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Visual Basic . Net Component in Asp.Net

    Once you have build your .NET component it will be compiled into a DLL. In your ASP.NET project, open Project Menu and select Add Reference, in the resulting dialog select browse and locate the DLL file (I would prefer putting the DLL file in the same location as other aspx files. Thats it.

    You will also have to add the namespace of the DLL project using the Imports statement.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    58

    Re: Visual Basic . Net Component in Asp.Net

    hi

    Yes i have complied the componenets and have got PigaDeal.dll as result than i kept that dll file into the /Bin Folder. Im using Dreamweaver to design to .aspx page so i have added the following statemtn in my .aspx page

    <%@ import namespace="PigaDeal" %>

    so it should refer to my component residing in the /bin directory but its giving me the following error

    Namespace or type 'PigaDeal' for the Imports 'PigaDeal' cannot be found.

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,484

    Re: Visual Basic . Net Component in Asp.Net

    This is not a VB.NET question. It is an ASP.NET question and should have been asked in the ASP.NET forum. I've never used Dreamweaver so I don't know exactly how it works, but if it's anything like Visual Studio then importing a namespace and referencing a library are two completely different things. The fact that your library is named PigaDeal.dll doesn't necessarily mean that it contains a namespace named PigaDeal. In Visual Studio you would have to add a reference to the library before you can access any namespaces it contains. Perhaps Dreamweaver knows to reference all the libraries in this bin folder automatically, but that error message suggests to me that that is not the case.

  7. #7
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: Visual Basic . Net Component in Asp.Net

    Check the root namespace of your component in VS by going to Project > Properties

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width