473,698 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

use vb.net function from classic asp page

I have a web application that contains asp.net and classic asp pages.
I have a vb.net function that I would like to use in one of the classic
asp pages. How can I do this? Can I do this?

Thanks,
Kent.

Mar 19 '06 #1
5 2310
I am assuming that your Classic ASP page(s) use VBScript for the server-side
code. If this is true, then no, you can't. Because the .NET code is compiled
(you create a .dll file) and Classic ASP code is interpreted (it does not
require a compiler, you just need a web server that supports Classic ASP),
they server-side code cannot be shared between them. However, one thing that
could make it easier to write code that does the same thing for Classic ASP
is to use the same, or a similar, algorithm to write a version for VBScript.
This shouldn't be too hard since many of the basic constructs are the same
in VBScript and VB.NET. But my personal advice would be to simply convert
the Classic ASP page(s) to ASP.NET, it is not a good idea to mix Classic ASP
and ASP.NET. If you would like any help doing any of these things, let me
know, I have worked with Classic ASP, VBScript, ASP.NET, and VB.NET.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

<Ke************ @gmail.com> wrote in message
news:11******** *************@i 39g2000cwa.goog legroups.com...
I have a web application that contains asp.net and classic asp pages.
I have a vb.net function that I would like to use in one of the classic
asp pages. How can I do this? Can I do this?

Thanks,
Kent.

Mar 20 '06 #2
Thanks for the help Nathan.

Kent.

Mar 20 '06 #3
Expose your .NET code as a COM object. Then both VBScript and JScript could
access it via CreateObject.

Mike Ober.

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
I am assuming that your Classic ASP page(s) use VBScript for the server-side code. If this is true, then no, you can't. Because the .NET code is compiled (you create a .dll file) and Classic ASP code is interpreted (it does not
require a compiler, you just need a web server that supports Classic ASP),
they server-side code cannot be shared between them. However, one thing that could make it easier to write code that does the same thing for Classic ASP is to use the same, or a similar, algorithm to write a version for VBScript. This shouldn't be too hard since many of the basic constructs are the same
in VBScript and VB.NET. But my personal advice would be to simply convert
the Classic ASP page(s) to ASP.NET, it is not a good idea to mix Classic ASP and ASP.NET. If you would like any help doing any of these things, let me
know, I have worked with Classic ASP, VBScript, ASP.NET, and VB.NET.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

<Ke************ @gmail.com> wrote in message
news:11******** *************@i 39g2000cwa.goog legroups.com...
I have a web application that contains asp.net and classic asp pages.
I have a vb.net function that I would like to use in one of the classic
asp pages. How can I do this? Can I do this?

Thanks,
Kent.



Mar 20 '06 #4
Considering the inefficiency inherent in doing that, wouldn't it be better to write your
own functions, compile them to unmanaged dll's in VB6 or C++6 and run them natively ?


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"Spam Catcher" <sp**********@r ogers.com> wrote in message
news:Xn******** *************** **********@127. 0.0.1...
Ke************@ gmail.com wrote in news:1142802701 .872006.48520
@i39g2000cwa.go oglegroups.com:
I have a web application that contains asp.net and classic asp pages.
I have a vb.net function that I would like to use in one of the classic
asp pages. How can I do this? Can I do this?


You can expose .NET DLLs as COM objects, then you can use them in classic
ASP via the Server.CreateOb ject("MyComObje ctName") command.

--
Stan Kee (sp**********@r ogers.com)

Boycott StarForce!
http://www.glop.org/starforce

Mar 20 '06 #5
re:
VB6 is more or less obsolete...
Yet, it's the only way to write unmanaged dll's for the web, other than C++.

You can't write COM objects with C#, however,
you can write COM objects with VB.NET :

http://msdn.microsoft.com/library/de...alBasicNET.asp

That is bound to be more efficient than writing a wrapper class for a COM object
and using that, but the OP wanted to use VB.NET functions from classic ASP.

That will be a performance hit no matter how you slice it,
unless you write an unmanaged COM object and use it directly in classic ASP.

re: So is the extra performance really worth the hassle?
That depends on how much performance you need.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"Spam Catcher" <sp**********@r ogers.com> wrote in message
news:Xn******** *************** ***********@127 .0.0.1... "Juan T. Llibre" <no***********@ nowhere.com> wrote in
news:#j******** ******@TK2MSFTN GP10.phx.gbl:
Considering the inefficiency inherent in doing that, wouldn't it be
better to write your own functions, compile them to unmanaged dll's in
VB6 or C++6 and run them natively ?
For most companies - probably not. VB6 is more or less obsolete... with
dwindling support from Microsoft. A lot of developers I know don't even
have Visual Studios 6.0 loaded on the machines anymore. For C++, we'll...
you'll need a C++ programmer. And with most companies I know, C++
programmers are dedicated to high priority projects or are expensive and
hard to come by.

So is the extra performance really worth the hassle?

--
Stan Kee (sp**********@r ogers.com)

Boycott StarForce!
http://www.glop.org/starforce

Mar 21 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2086
by: Rhek | last post by:
Hello, I have just moved an ASP Classic website to a new hosting company that has a number of .NET components available. The website works fine after the move with one exception. We were creating PDFs using ASPPDF for ASP but now it looks like only ABCPDF.NET is available. My knowledge of ASP.NET is very limited at this time and I am planning on converting the site to ASP.NET soon but I really need to get the PDF working as soon as I...
4
1767
by: Simon Harris | last post by:
Hi All, I'm new to ASP.Net, so be gentle! (Plenty of 'classic' ASP experience), just one question... - Am I correct in thinking that global functions are stored in ASCX files? Thanks! Simon.
2
1607
by: Rob Shorney | last post by:
Hi, We currently have a classic asp web application. We are currently looking at upgrading this to ASP.NET. However I have a couple of problems that need to be resolved. 1. aspx forms always post back to themselves. how do I get it to post to another web page.
3
2145
by: bill | last post by:
I need to open a asp.net web form from a classic asp page, and pass a username and password to the asp.net page. The username and password exist as session variables in the classic asp application. I can't put the password in the classic asp page form as a hidden field and submit it, because someone can view source and see the password. This is a security problem I encounter in a mixed classic asp and asp.net environment. I don't...
5
2950
by: Velvet | last post by:
Can someone tell me to what process I need to attach to be able to step through my classic ASP code in VS.net 2003. I'm working on an XP box with IIS installed. I also have VS.net 2005 (The final, never installed beta) installed on this box if it makes a difference (I did not install VS Development Web Server as I'm already using the XP web server). I've seen that I need to attach to the native IIS engine, but I don't know what it's...
1
1312
by: youngcraig | last post by:
Ok, so I have a predicament where I need to build a page harness using ASP.NET 2.0 that will render classic asp pages. What I am looking for is any information on being able to programatically render out a classic ASP page to the browser correctly from within a aspx page. So basically the user visits 'default.aspx' and the page spits out correctly rendered content that is actually written in classic ASP. I know the above sounds a little...
8
2422
by: antonyliu2002 | last post by:
We are extending a web application written in classic ASP long time ago. We will add more components to this web application in ASP.NET 2.0. To use the web application, our web users will have to log in with their user name and password. Well, instead of adding components to the existing classic ASP web application, we could have just put the extended components into a new web application. But then this would require them to log...
2
1913
by: fpennisi | last post by:
Hi all I have started writing a web app in Visual Studio 2005 (using c#). I am new to both C# and Visual Studio 2005. I will start by telling you what I need and then how I would have done it using classic ASP previously. What I need: - Within Visual Studio 2005 (c#) to create a reusable function within
7
1764
by: David | last post by:
Hi, I am attempting to do URL ReWriting with .NET to my classic ASP app. (Too big to upgrade to .NET at the moment). However, those who have tried will know that classic asp when rewritten doesn't work. Speaking to a friend of mine, he says (and I am sure I have seen it before as well) that I can run the classic ASP under the aspnet isapi. However, I can't find how to do that.
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2342
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.