Can a vb 2005 usercontrol be used in asp 2005?

B

billsahiker

I saw one post here that basically said no way, but not sure which vs
version was being discussed. Using vs 2005 I develped a user control
in a vb project and would like to use that usercontrol in a web app,
also developed with vs2005.
I tried using @Reference and put the dll in the bin folder, and when
that failed I created a Contols folder and put it there and still no
luck. Intuitively it makes sense that this does not work, since vb
usercontrols can contain controls not natively supported by asp. Mine,
for example, has two listview controls.


Bill
 
J

Juan T. Llibre

re:
Can a vb 2005 usercontrol be used in asp 2005?

First of all, there's no such thing as "asp 2005".

There's ASP.NET 2.0, which uses the .Net Framework 2.0,
which is the same .Net Framework targeted by VS 2005.

You should be able to easily use a user control in ASP.NET 2.0 and/or VS 2005.

Please review :
"How to: Create an ASP.NET User Control" :
http://msdn2.microsoft.com/en-us/library/26db8ysc.aspx

and

"How to: Include a User Control in an ASP.NET Web Page" :
http://msdn2.microsoft.com/en-us/library/sbz9etab.aspx
 
G

Guest

If the userControl is properly written, you should be able to bring it into
an existing ASP.NET solution, grab it with the mouse from the Solution pane,
and drag it right onto a blank ASP.NET page that's in design view.
Peter
 
B

billsahiker

To clarify, all my projects are in vs 2005. Please re-read my post
because you inferred that I am trying
to create a usercontrol in asp, which I am not. I stated that I
created a usercontrol in visual basic, and
want to re-use it in my asp project. I know I can use a visual basic
class library in an asp project, but I do not think a usercontrol
that is compiled with visual basic can be used in an asp project. If
it can I would like to know how to reference it
because I have tried the usual ways as explained in my post.
 
M

Mark Rae

you inferred that I am trying to create a usercontrol in asp, which
I am not.

That's effectively what you said: "vb" "visual basic" etc..

Are you actually talking about VB.NET...?
I stated that I created a usercontrol in visual basic

See above...
 
J

Juan T. Llibre

re:
!> you inferred that I am trying to create a usercontrol in asp, which I am not

The first thing we need to have you clear up is
what you're referring to when you say "asp".

Did you mean "active server pages", or did you mean "asp.net" ?
Generally, when we refer to "asp", we mean "active server pages".

Is your question related to "asp" or to "asp.net" ?

Secondly, what did you mean when you said that you are using "asp 2005" ?
As I explained, there's no such animal.

There's "asp.net 2.0" and there's "vs 2005".

Asp.net is a mix of web server technologies and
vs 2005 is an Integrated Development Environment (IDE).

re:
!> I created a usercontrol in visual basic

You did not.
"Visual Basic" is the name of a pre-vb.net language.

Vb.net is not "Visual Basic" any more, just as it isn't the language known as "basic" any more.
They're totally different programming languages.

re:
!> I know I can use a visual basic class library in an asp project

Only if you compile it with VB 5.0 or 6.0 and use "active server pages".

You *can't* use a "visual basic class library" in asp.net,
except by going through contortions like Pinvoke.

re:
!> I do not think a usercontrol that is compiled with visual basic can be used in an asp project

You, finally, said something which is undeniably correct.

User controls aren't usable in "active server pages".
I'm not sure, however, that you meant to refer to "active server pages".

I think you meant to refer "asp.net".
Did you ?

Summarizing, you need to make clearer whether you are
referring to "asp" ("active server pages") or to "asp.net".

....and you need to make clearer whether you are referring to "visual basic" or to "visual
basic.net".

The difference between them is critical and whether you get an answer
to your questions depends on us understanding what you are referring to.






To clarify, all my projects are in vs 2005. Please re-read my post
because you inferred that I am trying
to create a usercontrol in asp, which I am not. I stated that I
created a usercontrol in visual basic, and
want to re-use it in my asp project. I know I can use a visual basic
class library in an asp project, but I do not think a usercontrol
that is compiled with visual basic can be used in an asp project. If
it can I would like to know how to reference it
because I have tried the usual ways as explained in my post.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top