In VS 6.0 it was easy to create a new dll, compile it, and all the vb runtime
files were nicely added to it via the references that you gave.
Then in an ASP page youjust referenced, after registering it, like:
dll = sbsuserinfo
class = cluserinfo
function = CheckLogin
' Let's go write the record to db and create cookie if selected
Dim myobj
Set myobj = server.CreateObject("sbsuserinfo.cluserinfo")
if myobj.CheckLogin(d1,d2,d3) = 1 then
'Response.Write "<h1>Login Successful!</h1>"
Response.Redirect "Default.asp"
else
' Do nothing. Login unsuccessful!
End If
Set myobj = nothing
I can't seem to get this right in ASP.NET. I've created the new dll, a .vb
file that I compiled. I've added it to my VS.NET project as a reference and
it's in the /bin, but how do I now use those classes in the dll? I created
one test class and one function to pass two values, thus returning them back
slightly changed.
I want to reference this new dll and it's class/functions in my code-behind.
How can I do this? I've tried making the .vb code I complied into a
namespace to see it, but the functions, etc. are not available??????
Help.......... 3 1429
ok, I think I've figured most of it out.
I created a .vb file and made a new namespace in it. I compiled it and added
to my project. I then used:
Dim ns1 As New ns1.cl1
and then I saw it on my code-behind.
Question: does it have to be a namespace? I assume yes. And do the
functions, etc. have to be made public???
as a test, I created this .vb then compiled to dll:
Imports System
Imports System.Web
Namespace ns1
Class cl1
Public Function login(ByVal loginname As String, ByVal loginpassword
As String) As Integer
'HttpContext.Current.Response.Write("login: " & loginname &
"<br>")
'HttpContext.Current.Response.Write("password: " & loginpassword
& "<br>")
If loginname = "test" Then
HttpContext.Current.Session("login") = True
Else
HttpContext.Current.Session("login") = False
End If
login = 1
End Function
End Class
"Chris" wrote: In VS 6.0 it was easy to create a new dll, compile it, and all the vb runtime files were nicely added to it via the references that you gave. Then in an ASP page youjust referenced, after registering it, like: dll = sbsuserinfo class = cluserinfo function = CheckLogin
' Let's go write the record to db and create cookie if selected Dim myobj Set myobj = server.CreateObject("sbsuserinfo.cluserinfo") if myobj.CheckLogin(d1,d2,d3) = 1 then 'Response.Write "<h1>Login Successful!</h1>" Response.Redirect "Default.asp" else ' Do nothing. Login unsuccessful! End If
Set myobj = nothing
I can't seem to get this right in ASP.NET. I've created the new dll, a .vb file that I compiled. I've added it to my VS.NET project as a reference and it's in the /bin, but how do I now use those classes in the dll? I created one test class and one function to pass two values, thus returning them back slightly changed.
I want to reference this new dll and it's class/functions in my code-behind. How can I do this? I've tried making the .vb code I complied into a namespace to see it, but the functions, etc. are not available??????
Help..........
Hi Chris:
The new classes do not have to be in a different namespace, but that is the
generally accepted practice.
The functions do have to be public for you to call them from outside the
project.
--
Scott http://www.OdeToCode.com/blogs/scott/ ok, I think I've figured most of it out. I created a .vb file and made a new namespace in it. I compiled it and added to my project. I then used: Dim ns1 As New ns1.cl1 and then I saw it on my code-behind. Question: does it have to be a namespace? I assume yes. And do the functions, etc. have to be made public???
as a test, I created this .vb then compiled to dll:
Imports System Imports System.Web Namespace ns1
Class cl1
Public Function login(ByVal loginname As String, ByVal loginpassword As String) As Integer 'HttpContext.Current.Response.Write("login: " & loginname & "<br>") 'HttpContext.Current.Response.Write("password: " & loginpassword & "<br>") If loginname = "test" Then HttpContext.Current.Session("login") = True Else HttpContext.Current.Session("login") = False End If login = 1 End Function
End Class
"Chris" wrote:
In VS 6.0 it was easy to create a new dll, compile it, and all the vb runtime files were nicely added to it via the references that you gave. Then in an ASP page youjust referenced, after registering it, like: dll = sbsuserinfo class = cluserinfo function = CheckLogin ' Let's go write the record to db and create cookie if selected Dim myobj Set myobj = server.CreateObject("sbsuserinfo.cluserinfo") if myobj.CheckLogin(d1,d2,d3) = 1 then 'Response.Write "<h1>Login Successful!</h1>" Response.Redirect "Default.asp" else ' Do nothing. Login unsuccessful! End If Set myobj = nothing
I can't seem to get this right in ASP.NET. I've created the new dll, a .vb file that I compiled. I've added it to my VS.NET project as a reference and it's in the /bin, but how do I now use those classes in the dll? I created one test class and one function to pass two values, thus returning them back slightly changed.
I want to reference this new dll and it's class/functions in my code-behind. How can I do this? I've tried making the .vb code I complied into a namespace to see it, but the functions, etc. are not available??????
Help..........
thanx. how dare they move us out of our comfort zones :).
"Scott Allen" wrote: Hi Chris:
The new classes do not have to be in a different namespace, but that is the generally accepted practice.
The functions do have to be public for you to call them from outside the project.
-- Scott http://www.OdeToCode.com/blogs/scott/
ok, I think I've figured most of it out. I created a .vb file and made a new namespace in it. I compiled it and added to my project. I then used: Dim ns1 As New ns1.cl1 and then I saw it on my code-behind. Question: does it have to be a namespace? I assume yes. And do the functions, etc. have to be made public???
as a test, I created this .vb then compiled to dll:
Imports System Imports System.Web Namespace ns1
Class cl1
Public Function login(ByVal loginname As String, ByVal loginpassword As String) As Integer 'HttpContext.Current.Response.Write("login: " & loginname & "<br>") 'HttpContext.Current.Response.Write("password: " & loginpassword & "<br>") If loginname = "test" Then HttpContext.Current.Session("login") = True Else HttpContext.Current.Session("login") = False End If login = 1 End Function
End Class
"Chris" wrote:
In VS 6.0 it was easy to create a new dll, compile it, and all the vb runtime files were nicely added to it via the references that you gave. Then in an ASP page youjust referenced, after registering it, like: dll = sbsuserinfo class = cluserinfo function = CheckLogin ' Let's go write the record to db and create cookie if selected Dim myobj Set myobj = server.CreateObject("sbsuserinfo.cluserinfo") if myobj.CheckLogin(d1,d2,d3) = 1 then 'Response.Write "<h1>Login Successful!</h1>" Response.Redirect "Default.asp" else ' Do nothing. Login unsuccessful! End If Set myobj = nothing
I can't seem to get this right in ASP.NET. I've created the new dll, a .vb file that I compiled. I've added it to my VS.NET project as a reference and it's in the /bin, but how do I now use those classes in the dll? I created one test class and one function to pass two values, thus returning them back slightly changed.
I want to reference this new dll and it's class/functions in my code-behind. How can I do this? I've tried making the .vb code I complied into a namespace to see it, but the functions, etc. are not available??????
Help.......... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: xuatla |
last post by:
Hi,
I encountered the following compile error of c++ and hope to get your help.
test2.cpp: In member function `CTest CTest::operator+=(CTest&)':
test2.cpp:79: error: no match for 'operator='...
|
by: Sygen |
last post by:
I am attempting to create a simple recordset that would return the
number of duplicates that exist in a table with a single column. For
example if I had a table like the following:
ID ...
|
by: Vladislav Moltchanov |
last post by:
Recently I have changed from Acc97 to Acc2000 (I had to supply some data
entry tools for field data collection for users still using Acc97).
Among lot of other complications coming with Acc2000...
|
by: den.NET |
last post by:
well,i use visual c++.NET 2003.i am organizing a windows form
application.i attached a form shape to tell my problem( please coppy
this url and have a look :...
|
by: GrandpaB |
last post by:
While writing this plea for help, I think I solved my
dilemma, but I don't know why the problem solving
statement is necessary. The inspiration for the
statement came from an undocumented VB...
|
by: Richard Lewis Haggard |
last post by:
We are having a lot of trouble with problems relating to failures relating
to 'The located assembly's manifest definition with name 'xxx' does not
match the assembly reference" but none of us here...
|
by: key9 |
last post by:
Hi All
On coding , I think I need some basic help about how to write member
function .
I've readed the FAQ, but I am still confuse about it when coding(reference /
pointer /instance) , so I...
|
by: Hexman |
last post by:
Hello All,
I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm
using some VB6 code, .Net2003 code,...
|
by: Daveo |
last post by:
Hi there,
I have a query (say it's called "Query1") that contains data in the
following structure:
id reference scoretype score
-- -------------- -------------- ...
|
by: hcaptech |
last post by:
This is my Test.can you help me ?
1.Which of the following statement about C# varialble is incorrect ?
A.A variable is a computer memory location identified by a unique name
B.A variable's name...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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,...
|
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...
| | |