473,323 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

How to share VB code across multiple pages?

I am new to .NET framework.

A bunch of web pages of mine need the same function. Right now, I put
the Subs in each individual page.

I think there must be a way to save my Subs in a separate file and then
have each web page link to it. Could you guys please let me know how
to do this? Thanks a lot!

Nov 19 '05 #1
14 3039
> A bunch of web pages of mine need the same function. Right now, I put
the Subs in each individual page.

I think there must be a way to save my Subs in a separate file and then
have each web page link to it. Could you guys please let me know how
to do this? Thanks a lot!


There are a variety of ways. One way is to just make a new class file (a .vb
or .cs file) and then reference the function that way.

I typically make a new class file called sharedFunctions and then put
specific functions within it. I can then reference them from any file in the
project: sharedFunctions.myFunction()

-Darrel
Nov 19 '05 #2
> I think there must be a way to save my Subs in a separate file and then
have each web page link to it. Could you guys please let me know how
to do this? Thanks a lot!
ASP.Net is fully-compiled and object-oriented. So, one of the first things
you need to do as a new ASP.Net programmer is to retrain your thinking.
There are no pages in an ASP.Net application. There are only classes. A
System.Web.UI.Page is a class, and that template you create is just part of
the class definition.

So, you don't ever define Subs in files. They are methods in classes.

Now, the reason I'm sayiing this is that you need to create a class that
contains your common Subs, and use that in all of your Page classes. It
doesn't have direct access to the HttpContext that is passed to a page, but
remember that it will be used BY a Page, which does have the HttpContext.
And you can reference it in your class thusly:

' Using Request as a part of the HttpContext
Public Sub DoSomething()
Dim Request As HttpRequest = CType(HttpContext.Current.Handler,
System.Web.UI.Page).Request
If Request.QueryString("SomeParameter") = "foo" Then
'Do Something
End If
End Sub

It will really help you to reflect on the Object-oriented nature of .Net, in
order to leverage it to its fullest extent.

HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Big things are made up of
lots of little things.

<an***********@yahoo.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...I am new to .NET framework.

A bunch of web pages of mine need the same function. Right now, I put
the Subs in each individual page.

I think there must be a way to save my Subs in a separate file and then
have each web page link to it. Could you guys please let me know how
to do this? Thanks a lot!

Nov 19 '05 #3
Hi, Thx.

After I got your reply, then I created a file called "MyClass.vb" in
the same folder of the webpages.

MyClass.vb has a Class like this:

Public Class MyClass
Public Sub MySub()
Do Something
End Sub
End Class

I called the MySub like this in my webpage:

Call MyClass.MySub()

This is the compile error:

BC30456: 'MySub' is not a member of 'ASP.Page1_aspx'.

Apparently I did not do it in the right way. I think I am doing it
like Java. I was a Java programmer.

Shouldn't I tell Page1.aspx where to find that function?

darrel wrote:
A bunch of web pages of mine need the same function. Right now, I put
the Subs in each individual page.

I think there must be a way to save my Subs in a separate file and then
have each web page link to it. Could you guys please let me know how
to do this? Thanks a lot!


There are a variety of ways. One way is to just make a new class file (a .vb
or .cs file) and then reference the function that way.

I typically make a new class file called sharedFunctions and then put
specific functions within it. I can then reference them from any file in the
project: sharedFunctions.myFunction()

-Darrel


Nov 19 '05 #4
Thanks, Kevin, I was a Java programmer. So I think that I know a little
bit about OO programming. It is a new thing to me that .Net framwork
does not have a page. Because of this, I am kinda confused by the
sample code your provided.

Nov 19 '05 #5
If you're using ASP.NET 2.0, place MyClass.vb
in the App_Code folder. You'll be able to access it there.

If you're using ASP.NET 1.1, you should command-line compile
MyClass.vb to MyClass.dll and place it in the /bin drectory.

You, then, can import the namespace in your aspx file with :
<%@ Import Namespace="YourNameSpaceName" %>
and instantiate your classes from any aspx page.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi, Thx.

After I got your reply, then I created a file called "MyClass.vb" in
the same folder of the webpages.

MyClass.vb has a Class like this:

Public Class MyClass
Public Sub MySub()
Do Something
End Sub
End Class

I called the MySub like this in my webpage:

Call MyClass.MySub()

This is the compile error:

BC30456: 'MySub' is not a member of 'ASP.Page1_aspx'.

Apparently I did not do it in the right way. I think I am doing it
like Java. I was a Java programmer.

Shouldn't I tell Page1.aspx where to find that function?

darrel wrote:
> A bunch of web pages of mine need the same function. Right now, I put
> the Subs in each individual page.
>
> I think there must be a way to save my Subs in a separate file and then
> have each web page link to it. Could you guys please let me know how
> to do this? Thanks a lot!


There are a variety of ways. One way is to just make a new class file (a .vb
or .cs file) and then reference the function that way.

I typically make a new class file called sharedFunctions and then put
specific functions within it. I can then reference them from any file in the
project: sharedFunctions.myFunction()

-Darrel

Nov 19 '05 #6
Hi, Juan,

Yes, I am using ASP.NET 1.1. I tried compiling MyClass.vb using
vbc.exe, but got an error message as follows:

"The application has failed to start because MSVCR71.dll was not
found.Reinstalling this application may fix this problem"

But MSVCR71.dll is actually right there under the folder
Windows\Microsoft.NET\Framework\v1.1.4322. How to fix this please?

By the way, how to get ASP.NET 2.0? Is it freely upgradable?
Juan T. Llibre wrote:
If you're using ASP.NET 2.0, place MyClass.vb
in the App_Code folder. You'll be able to access it there.

If you're using ASP.NET 1.1, you should command-line compile
MyClass.vb to MyClass.dll and place it in the /bin drectory.

You, then, can import the namespace in your aspx file with :
<%@ Import Namespace="YourNameSpaceName" %>
and instantiate your classes from any aspx page.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi, Thx.

After I got your reply, then I created a file called "MyClass.vb" in
the same folder of the webpages.

MyClass.vb has a Class like this:

Public Class MyClass
Public Sub MySub()
Do Something
End Sub
End Class

I called the MySub like this in my webpage:

Call MyClass.MySub()

This is the compile error:

BC30456: 'MySub' is not a member of 'ASP.Page1_aspx'.

Apparently I did not do it in the right way. I think I am doing it
like Java. I was a Java programmer.

Shouldn't I tell Page1.aspx where to find that function?

darrel wrote:
> A bunch of web pages of mine need the same function. Right now, I put
> the Subs in each individual page.
>
> I think there must be a way to save my Subs in a separate file and then
> have each web page link to it. Could you guys please let me know how
> to do this? Thanks a lot!

There are a variety of ways. One way is to just make a new class file (a .vb
or .cs file) and then reference the function that way.

I typically make a new class file called sharedFunctions and then put
specific functions within it. I can then reference them from any file in the
project: sharedFunctions.myFunction()

-Darrel


Nov 19 '05 #7
re:
I tried compiling MyClass.vb using vbc.exe, but got an error message
Was your compilation attempt made from a directory
included in your system's environment path ?

It could also be that you have a failed .Net Framework install.
Uninstalling and reinstalling the .Net framework would help in that case.

re:how to get ASP.NET 2.0? Is it freely upgradable?
If you are an MSDN subscriber,you can download the RC at :
http://lab.msdn.microsoft.com/vs2005/get/default.aspx

Otherwise, you can download the public 2.0 Beta versions here :
http://lab.msdn.microsoft.com/vs2005/get/default.aspx

Also, there's a download which includes the
Beta 2 Visual Web Developer version at :

http://lab.msdn.microsoft.com/express/vwd/default.aspx


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi, Juan,

Yes, I am using ASP.NET 1.1. I tried compiling MyClass.vb using
vbc.exe, but got an error message as follows:

"The application has failed to start because MSVCR71.dll was not
found.Reinstalling this application may fix this problem"

But MSVCR71.dll is actually right there under the folder
Windows\Microsoft.NET\Framework\v1.1.4322. How to fix this please?

By the way, how to get ASP.NET 2.0? Is it freely upgradable?
Juan T. Llibre wrote: If you're using ASP.NET 2.0, place MyClass.vb
in the App_Code folder. You'll be able to access it there.

If you're using ASP.NET 1.1, you should command-line compile
MyClass.vb to MyClass.dll and place it in the /bin drectory.

You, then, can import the namespace in your aspx file with :
<%@ Import Namespace="YourNameSpaceName" %>
and instantiate your classes from any aspx page.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi, Thx.

After I got your reply, then I created a file called "MyClass.vb" in
the same folder of the webpages.

MyClass.vb has a Class like this:

Public Class MyClass
Public Sub MySub()
Do Something
End Sub
End Class

I called the MySub like this in my webpage:

Call MyClass.MySub()

This is the compile error:

BC30456: 'MySub' is not a member of 'ASP.Page1_aspx'.

Apparently I did not do it in the right way. I think I am doing it
like Java. I was a Java programmer.

Shouldn't I tell Page1.aspx where to find that function?

darrel wrote:
> A bunch of web pages of mine need the same function. Right now, I put
> the Subs in each individual page.
>
> I think there must be a way to save my Subs in a separate file and then
> have each web page link to it. Could you guys please let me know how
> to do this? Thanks a lot!

There are a variety of ways. One way is to just make a new class file (a .vb
or .cs file) and then reference the function that way.

I typically make a new class file called sharedFunctions and then put
specific functions within it. I can then reference them from any file in the
project: sharedFunctions.myFunction()

-Darrel

Nov 19 '05 #8
Hi, Juan,

Yes, I've set the PATH variable. But I am still getting that error
message.

That said, I have downloaded and installed the ASP.20 Visual Web
Developer kit and issued aspnet_regiis.exe -i.

Now, when I check out my web application, I get this error message:

******************************************
Server Error in '/' Application.
Validation of viewstate MAC failed. If this application is hosted by a
Web Farm or cluster, ensure that <machineKey> configuration specifies
the same validationKey and validation algorithm. AutoGenerate cannot be
used in a cluster.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Validation of viewstate
MAC failed. If this application is hosted by a Web Farm or cluster,
ensure that <machineKey> configuration specifies the same validationKey
and validation algorithm. AutoGenerate cannot be used in a cluster.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
******************************************


Juan T. Llibre wrote:
re:
I tried compiling MyClass.vb using vbc.exe, but got an error message


Was your compilation attempt made from a directory
included in your system's environment path ?

It could also be that you have a failed .Net Framework install.
Uninstalling and reinstalling the .Net framework would help in that case.

re:
how to get ASP.NET 2.0? Is it freely upgradable?


If you are an MSDN subscriber,you can download the RC at :
http://lab.msdn.microsoft.com/vs2005/get/default.aspx

Otherwise, you can download the public 2.0 Beta versions here :
http://lab.msdn.microsoft.com/vs2005/get/default.aspx

Also, there's a download which includes the
Beta 2 Visual Web Developer version at :

http://lab.msdn.microsoft.com/express/vwd/default.aspx


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi, Juan,

Yes, I am using ASP.NET 1.1. I tried compiling MyClass.vb using
vbc.exe, but got an error message as follows:

"The application has failed to start because MSVCR71.dll was not
found.Reinstalling this application may fix this problem"

But MSVCR71.dll is actually right there under the folder
Windows\Microsoft.NET\Framework\v1.1.4322. How to fix this please?

By the way, how to get ASP.NET 2.0? Is it freely upgradable?
Juan T. Llibre wrote:
If you're using ASP.NET 2.0, place MyClass.vb
in the App_Code folder. You'll be able to access it there.

If you're using ASP.NET 1.1, you should command-line compile
MyClass.vb to MyClass.dll and place it in the /bin drectory.

You, then, can import the namespace in your aspx file with :
<%@ Import Namespace="YourNameSpaceName" %>
and instantiate your classes from any aspx page.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi, Thx.

After I got your reply, then I created a file called "MyClass.vb" in
the same folder of the webpages.

MyClass.vb has a Class like this:

Public Class MyClass
Public Sub MySub()
Do Something
End Sub
End Class

I called the MySub like this in my webpage:

Call MyClass.MySub()

This is the compile error:

BC30456: 'MySub' is not a member of 'ASP.Page1_aspx'.

Apparently I did not do it in the right way. I think I am doing it
like Java. I was a Java programmer.

Shouldn't I tell Page1.aspx where to find that function?

darrel wrote:
> > A bunch of web pages of mine need the same function. Right now, Iput
> > the Subs in each individual page.
> >
> > I think there must be a way to save my Subs in a separate file andthen
> > have each web page link to it. Could you guys please let me know how
> > to do this? Thanks a lot!
>
> There are a variety of ways. One way is to just make a new class file (a .vb
> or .cs file) and then reference the function that way.
>
> I typically make a new class file called sharedFunctions and then put
> specific functions within it. I can then reference them from any file in the
> project: sharedFunctions.myFunction()
>
> -Darrel


Nov 19 '05 #9
re:
That said, I have downloaded and installed the ASP.20
Visual Web Developer kit and issued aspnet_regiis.exe -i.
From which .Net Framework directory ?

From the 1.1 .Net Framework dir, or from the 2.0 directory ?

Also, did you change your application's directory so it runs
the 2.0 ASP.NET version, or is it still running the 1.1 version ?

If the ASP.NET tab is available in the IIS Manager, change
the target .Net Framework version to the appropiate one.

If it's not available, download Denis Bauer's ASP.NET Version Switcher
and change the ASP.NET version for you app withj that :

http://www.denisbauer.com/NETTools/A...nSwitcher.aspx

Remember that now that you're running two versions of ASP.NET that,
at least, all 1.1 apps will need to be in one AppPool and all 2.0 apps
will need to be in a different AppPool.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi, Juan,

Yes, I've set the PATH variable. But I am still getting that error
message.

That said, I have downloaded and installed the ASP.20 Visual Web
Developer kit and issued aspnet_regiis.exe -i.

Now, when I check out my web application, I get this error message:

******************************************
Server Error in '/' Application.
Validation of viewstate MAC failed. If this application is hosted by a
Web Farm or cluster, ensure that <machineKey> configuration specifies
the same validationKey and validation algorithm. AutoGenerate cannot be
used in a cluster.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Validation of viewstate
MAC failed. If this application is hosted by a Web Farm or cluster,
ensure that <machineKey> configuration specifies the same validationKey
and validation algorithm. AutoGenerate cannot be used in a cluster.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
******************************************


Juan T. Llibre wrote: re:
I tried compiling MyClass.vb using vbc.exe, but got an error message


Was your compilation attempt made from a directory
included in your system's environment path ?

It could also be that you have a failed .Net Framework install.
Uninstalling and reinstalling the .Net framework would help in that case.

re:
how to get ASP.NET 2.0? Is it freely upgradable?


If you are an MSDN subscriber,you can download the RC at :
http://lab.msdn.microsoft.com/vs2005/get/default.aspx

Otherwise, you can download the public 2.0 Beta versions here :
http://lab.msdn.microsoft.com/vs2005/get/default.aspx

Also, there's a download which includes the
Beta 2 Visual Web Developer version at :

http://lab.msdn.microsoft.com/express/vwd/default.aspx


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi, Juan,

Yes, I am using ASP.NET 1.1. I tried compiling MyClass.vb using
vbc.exe, but got an error message as follows:

"The application has failed to start because MSVCR71.dll was not
found.Reinstalling this application may fix this problem"

But MSVCR71.dll is actually right there under the folder
Windows\Microsoft.NET\Framework\v1.1.4322. How to fix this please?

By the way, how to get ASP.NET 2.0? Is it freely upgradable?
Juan T. Llibre wrote:
If you're using ASP.NET 2.0, place MyClass.vb
in the App_Code folder. You'll be able to access it there.

If you're using ASP.NET 1.1, you should command-line compile
MyClass.vb to MyClass.dll and place it in the /bin drectory.

You, then, can import the namespace in your aspx file with :
<%@ Import Namespace="YourNameSpaceName" %>
and instantiate your classes from any aspx page.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi, Thx.

After I got your reply, then I created a file called "MyClass.vb" in
the same folder of the webpages.

MyClass.vb has a Class like this:

Public Class MyClass
Public Sub MySub()
Do Something
End Sub
End Class

I called the MySub like this in my webpage:

Call MyClass.MySub()

This is the compile error:

BC30456: 'MySub' is not a member of 'ASP.Page1_aspx'.

Apparently I did not do it in the right way. I think I am doing it
like Java. I was a Java programmer.

Shouldn't I tell Page1.aspx where to find that function?

darrel wrote:
> > A bunch of web pages of mine need the same function. Right now, I put
> > the Subs in each individual page.
> >
> > I think there must be a way to save my Subs in a separate file and then
> > have each web page link to it. Could you guys please let me know how
> > to do this? Thanks a lot!
>
> There are a variety of ways. One way is to just make a new class file (a .vb
> or .cs file) and then reference the function that way.
>
> I typically make a new class file called sharedFunctions and then put
> specific functions within it. I can then reference them from any file in the
> project: sharedFunctions.myFunction()
>
> -Darrel

Nov 19 '05 #10
Juan T. Llibre wrote:
re:
That said, I have downloaded and installed the ASP.20
Visual Web Developer kit and issued aspnet_regiis.exe -i.
From which .Net Framework directory ?
From the 1.1 .Net Framework dir, or from the 2.0 directory ?


I issued the aspnet_regiis.exe -i from the v2.0.50215 folder.
Also, did you change your application's directory so it runs
the 2.0 ASP.NET version, or is it still running the 1.1 version ?
No, I did not. Do you mean that applications for ASP.NET 2.0 must
reside in a directory different from those of ASP.NET 1.1?
If the ASP.NET tab is available in the IIS Manager, change
the target .Net Framework version to the appropiate one.
Yes, the tabs are visible. Both v1.1.4322 and v2.0.50215 are
"Allowed". Do you mean that I should "prohibit" v1.1.4322?
If it's not available, download Denis Bauer's ASP.NET Version Switcher
and change the ASP.NET version for you app withj that :

http://www.denisbauer.com/NETTools/A...nSwitcher.aspx

Remember that now that you're running two versions of ASP.NET that,
at least, all 1.1 apps will need to be in one AppPool and all 2.0 apps
will need to be in a different AppPool.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================


Nov 19 '05 #11
re:
No, I did not. Do you mean that applications for ASP.NET 2.0
must reside in a directory different from those of ASP.NET 1.1?
You can't have the same application running under both
1.1 and 2.0 in the same physical, or virtual, directory.

Also, they must run in a different Application Pool.

re: Yes, the tabs are visible. Both v1.1.4322 and v2.0.50215 are
"Allowed". Do you mean that I should "prohibit" v1.1.4322?
No.

Only that your 1.1 apps must run in a different AppPool than 2.0's.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Juan T. Llibre wrote: re:
That said, I have downloaded and installed the ASP.20
Visual Web Developer kit and issued aspnet_regiis.exe -i.
From which .Net Framework directory ?
From the 1.1 .Net Framework dir, or from the 2.0 directory ?


I issued the aspnet_regiis.exe -i from the v2.0.50215 folder.
Also, did you change your application's directory so it runs
the 2.0 ASP.NET version, or is it still running the 1.1 version ?
No, I did not. Do you mean that applications for ASP.NET 2.0 must
reside in a directory different from those of ASP.NET 1.1?
If the ASP.NET tab is available in the IIS Manager, change
the target .Net Framework version to the appropiate one.


Yes, the tabs are visible. Both v1.1.4322 and v2.0.50215 are
"Allowed". Do you mean that I should "prohibit" v1.1.4322?

Nov 19 '05 #12
Juan T. Llibre wrote:
re:
No, I did not. Do you mean that applications for ASP.NET 2.0
must reside in a directory different from those of ASP.NET 1.1?
You can't have the same application running under both
1.1 and 2.0 in the same physical, or virtual, directory.

Also, they must run in a different Application Pool.


I don't have a concept of Application Pool. So, will my 1.1
application run well with ASP.NET 2.0?

Also, will the problem be resolved if I disable 1.1.4322? It did not,
I tried.

re:
Yes, the tabs are visible. Both v1.1.4322 and v2.0.50215 are
"Allowed". Do you mean that I should "prohibit" v1.1.4322?


No.

Only that your 1.1 apps must run in a different AppPool than 2.0's.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Juan T. Llibre wrote:
re:
That said, I have downloaded and installed the ASP.20
Visual Web Developer kit and issued aspnet_regiis.exe -i.


From which .Net Framework directory ?
From the 1.1 .Net Framework dir, or from the 2.0 directory ?


I issued the aspnet_regiis.exe -i from the v2.0.50215 folder.
Also, did you change your application's directory so it runs
the 2.0 ASP.NET version, or is it still running the 1.1 version ?


No, I did not. Do you mean that applications for ASP.NET 2.0 must
reside in a directory different from those of ASP.NET 1.1?
If the ASP.NET tab is available in the IIS Manager, change
the target .Net Framework version to the appropiate one.


Yes, the tabs are visible. Both v1.1.4322 and v2.0.50215 are
"Allowed". Do you mean that I should "prohibit" v1.1.4322?


Nov 19 '05 #13
Hi, Juan,

Thank you very much. I think I need more time for ASP.NET 2.0.

I have uninstalled the 2.0 version and will stay with 1.1 for now. The
vbc compiler worked when I compiled the source under the v1.1.4322
folder where the msvcr71.dll resides.

But then I have a VB code problem:

******************************************
vbc : error BC30420: 'Sub Main' was not found in 'MyClass'.
f:\inetpub\wwwroot\test\MyClass.vb(1) : error BC30183: Keyword is not
valid as an identifier.

Public Class MyClass
~~~~~~~
******************************************

I am new to VB. I am a Java man. Does this mean that each VB class
must have a Sub Main? This sounds weird. Also, why isn't MyClass a
valid identifier?
Juan T. Llibre wrote:
re:
No, I did not. Do you mean that applications for ASP.NET 2.0
must reside in a directory different from those of ASP.NET 1.1?


You can't have the same application running under both
1.1 and 2.0 in the same physical, or virtual, directory.

Also, they must run in a different Application Pool.

re:
Yes, the tabs are visible. Both v1.1.4322 and v2.0.50215 are
"Allowed". Do you mean that I should "prohibit" v1.1.4322?


No.

Only that your 1.1 apps must run in a different AppPool than 2.0's.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Juan T. Llibre wrote:
re:
That said, I have downloaded and installed the ASP.20
Visual Web Developer kit and issued aspnet_regiis.exe -i.


From which .Net Framework directory ?
From the 1.1 .Net Framework dir, or from the 2.0 directory ?


I issued the aspnet_regiis.exe -i from the v2.0.50215 folder.
Also, did you change your application's directory so it runs
the 2.0 ASP.NET version, or is it still running the 1.1 version ?


No, I did not. Do you mean that applications for ASP.NET 2.0 must
reside in a directory different from those of ASP.NET 1.1?
If the ASP.NET tab is available in the IIS Manager, change
the target .Net Framework version to the appropiate one.


Yes, the tabs are visible. Both v1.1.4322 and v2.0.50215 are
"Allowed". Do you mean that I should "prohibit" v1.1.4322?


Nov 19 '05 #14
Hi, Antony.

re:
But then I have a VB code problem:
vbc : error BC30420: 'Sub Main' was not found in 'MyClass'.
f:\inetpub\wwwroot\test\MyClass.vb(1) : error BC30183:
Keyword is not valid as an identifier. Public Class MyClass
Does this mean that each VB class must have a Sub Main?
Are you creating a Windows Forms application ( instead of a web aplication ) ?

You don't need "Sub Main" in web applications...

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi, Juan,

Thank you very much. I think I need more time for ASP.NET 2.0.

I have uninstalled the 2.0 version and will stay with 1.1 for now. The
vbc compiler worked when I compiled the source under the v1.1.4322
folder where the msvcr71.dll resides.

But then I have a VB code problem:

******************************************
vbc : error BC30420: 'Sub Main' was not found in 'MyClass'.
f:\inetpub\wwwroot\test\MyClass.vb(1) : error BC30183: Keyword is not
valid as an identifier.

Public Class MyClass
~~~~~~~
******************************************

I am new to VB. I am a Java man. Does this mean that each VB class
must have a Sub Main? This sounds weird. Also, why isn't MyClass a
valid identifier?
Juan T. Llibre wrote: re:
No, I did not. Do you mean that applications for ASP.NET 2.0
must reside in a directory different from those of ASP.NET 1.1?


You can't have the same application running under both
1.1 and 2.0 in the same physical, or virtual, directory.

Also, they must run in a different Application Pool.

re:
Yes, the tabs are visible. Both v1.1.4322 and v2.0.50215 are
"Allowed". Do you mean that I should "prohibit" v1.1.4322?


No.

Only that your 1.1 apps must run in a different AppPool than 2.0's.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<an***********@yahoo.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Juan T. Llibre wrote:
re:
That said, I have downloaded and installed the ASP.20
Visual Web Developer kit and issued aspnet_regiis.exe -i.


From which .Net Framework directory ?
From the 1.1 .Net Framework dir, or from the 2.0 directory ?


I issued the aspnet_regiis.exe -i from the v2.0.50215 folder.
Also, did you change your application's directory so it runs
the 2.0 ASP.NET version, or is it still running the 1.1 version ?


No, I did not. Do you mean that applications for ASP.NET 2.0 must
reside in a directory different from those of ASP.NET 1.1?
If the ASP.NET tab is available in the IIS Manager, change
the target .Net Framework version to the appropiate one.


Yes, the tabs are visible. Both v1.1.4322 and v2.0.50215 are
"Allowed". Do you mean that I should "prohibit" v1.1.4322?

Nov 19 '05 #15

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

Similar topics

2
by: TaeHo Yoo | last post by:
Hi all, I have a solution which contains multiple projects. Those multiple projects should share the same session. For example, users login, create the session for users then these session...
3
by: Jon Paugh | last post by:
Hi, If I have several aspx pages that I want to share across multiple web applications, how would I organize them? Basically, a subset of the pages on a given site will be on several sites....
1
by: Jheitmuller | last post by:
Hi, What is the best way to share a C# web form across web application? I'm new to ASP.NET. I've read though the docs and I must be missing something. I do not see and appropriate library...
5
by: Raed Sawalha | last post by:
We have a web application with at least 570 Pages and 10's of user controls ....all under project name LinkDevProject ...recently we start separating the project into multiple projects ....the...
9
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of...
6
by: antonyliu2002 | last post by:
I am using ASP.NET 1.1. In my web application, multiple pages will be using the same functions. I am wondering if I can just pick out the shared code and save it in a separate file and then...
15
by: Neo | last post by:
Hello All, I found that ASP.net website only accepts code withing site directory. This creates big hurdle in shairng code. How to share code between two websites, like the way share between two...
4
by: Mike | last post by:
Class A public objX I want to create 2 or more instances of Class A and have the same value for objX in all instances. Instance1 of Class A Instance2 of Class A Instance3 of Class A
9
by: moondaddy | last post by:
I'm using asp.net 2.0 and c# and would like to share some user control between several websites. these websites are on the same server and have a physical location right next to each other like...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.