using vb.net DLL class in inline 1.0 code without referencing DLL inproject??

W

wildman

Old vb.net asp.net 1.0 vb.net website. We don't have sources, nor can
I compile it.

One the pages must be replaced to simply redirect to another webserver/
website page, but I need to send some of the session info that the
site. Of course session info is lost.

Challenge is I'd like to use a new class to store session information
in a database.

Currently I have some inline code (on the old site replacing that
page) that's able to read the session variables and redirect to the
new site. I could of course simply pass the data I want in a query
string, but I'd rather store it in a database.

How do i refrence a dll just in the inline vbscript?

Thanks for any help or information!
 
K

kimiraikkonen

Old vb.net asp.net 1.0 vb.net website. We don't have sources, nor can
I compile it.

One the pages must be replaced to simply redirect to another webserver/
website page, but I need to send some of the session info that the
site. Of course session info is lost.

Challenge is I'd like to use a new class to store session information
in a database.

Currently I have some inline code (on the old site replacing that
page) that's able to read the session variables and redirect to the
new site. I could of course simply pass the data I want in a query
string, but I'd rather store it in a database.

How do i refrence a dll just in the inline vbscript?

Thanks for any help or information!

If you having diffuculties or inconsistencies referencing a DLL, just
copy the DLL's codes of functions, properties, procedures.. etc. and
call them in the same .vb source code file. Fairly applicable.

Example:

Assume you have a DLL and its content is:

Public Class Foo

Public Function myfunction(ByVal xyz As Integer) As Integer

' Code that function will return

return ' whatsoever

End Function

End Class

Now, just copy this into your .vb source code:

Public Function myfunction(ByVal xyz As Integer) As Integer

' Code that function will return

return ' whatsoever

End Function


Then just call the function from anywhere(event or procedure) with
"myfunction()"

I hope that's it.

Hope this helps.
 
W

wildman

Can I call classes for DLL compiled in .net 2.0 on a server that only
has .net 1.0?


What I've have done in the past.. and it's not working for some
reason...

is drop my vb.net 2.0 class library DLL in the BIN directory of the
old project.


that class has a namespace JCP.


then in my inline code (on the 1.0 side):


<%@ Import Namespace="JCP"%>


and in my code
Dim xx as new JCP.Myclass(")


But this gives me error:


Type 'JCP.Myclass' is not defined.


I'm not sure how If I can use the @Assembly directive? Also, do I
need to
worry that my class was compiled in 2.0 and that this server only has
1.0 .NET framework installed?


my namespace is JCP
my class is MyClass
the file is MyClass.DLL
It's compiled in 2.0
I'm attempting to access it from 1.0 (which sounds like might be a
problem anyway )


Thank you.
 
K

kimiraikkonen

Can I call classes for DLL compiled in .net 2.0 on a server that only
has .net 1.0?

What I've have done in the past.. and it's not working for some
reason...

is drop my vb.net 2.0 class library DLL in the BIN directory of the
old project.

that class has a namespace JCP.

then in my inline code (on the 1.0 side):

<%@ Import Namespace="JCP"%>

and in my code
      Dim xx as new JCP.Myclass(")

But this gives me error:

Type 'JCP.Myclass' is not defined.

I'm not sure how If I  can use the @Assembly directive? Also, do I
need to
worry that my class was compiled in 2.0 and that this server only has
1.0 .NET framework installed?

my namespace is JCP
my class is MyClass
the file is MyClass.DLL
It's compiled in 2.0
I'm attempting to access it from 1.0 (which sounds like might be a
problem anyway )

Thank you.

That's why you should know the source code of DLL that contains the
namespace and classes. Then include DLL's code to your single vb
source code. If not, you should reference IMHO.

BTW, i may have understood your issue wrong, if so, sorry.
 
G

GS

I must have missed something, I seem to read as cross site scripting
are you sure you want to allow cross site scripting vulnerabilities?
 
W

wildman

That's why you should know the source code of DLL that contains the
namespace and classes. Then include DLL's code to your single vb
source code. If not, you should reference IMHO.

BTW, i may have understood your issue wrong, if so, sorry.- Hide quoted text -

- Show quoted text -


I did that and of course it works, but it would have been nice to
reference the dll somehow.

thanks.
 

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

Top