473,785 Members | 2,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using DLL in ASPX

Using VBC, I compiled a VB class file into a DLL named MyPro.dll. The
namespace used in this class file is 'MyPro' & the public class is
named 'MyClass'. This is the ASPX page which imports the namespace &
instantiates the class 'MyClass' so that the ASPX code can invoke the
different functions existing within the class 'MyClass':

<%@ Import Namespace="MyPr o" %>

<script runat="server">
Public boMyClass As MyClass

Sub Page_Load(....)
boMyClass = New MyClass
...............
...............
End Sub

Sub MySub(....)
boMyClass = New MyClass
...............
...............
End Sub
</script>

Now what I find is though the above ASPX code works fine, on quite a
few occasions, when I make some changes in the ASPX page (not in the
class file) & then re-run the ASPX page in IE, ASP.NET generates the
error:

Name 'boMyClass' is not declared.

pointing to the line

Public boMyClass As MyClass

This forces me to compile the class (using VBC) again & again after
which only the ASPX page runs fine. Note that I didn't make any changes
in the class file (had I done that, then the class file, of course,
ought to be compiled each time any changes are made). I made changes
only in the ASPX page.

Can someone please tell me why am I encountering this error
intermittently?

Oct 14 '06 #1
4 3204

The object does not persist page to page (or on a "postback") ... therefore
you'll need to store the object somewhere to reuse it.

...

See
http://sholliday.spaces.live.com/blog/ 10/24/2005 entry

It has a object holder for asp.net.

Or you can use the Session["key"] object.
<rn**@rediffmai l.comwrote in message
news:11******** **************@ f16g2000cwb.goo glegroups.com.. .
Using VBC, I compiled a VB class file into a DLL named MyPro.dll. The
namespace used in this class file is 'MyPro' & the public class is
named 'MyClass'. This is the ASPX page which imports the namespace &
instantiates the class 'MyClass' so that the ASPX code can invoke the
different functions existing within the class 'MyClass':

<%@ Import Namespace="MyPr o" %>

<script runat="server">
Public boMyClass As MyClass

Sub Page_Load(....)
boMyClass = New MyClass
...............
...............
End Sub

Sub MySub(....)
boMyClass = New MyClass
...............
...............
End Sub
</script>

Now what I find is though the above ASPX code works fine, on quite a
few occasions, when I make some changes in the ASPX page (not in the
class file) & then re-run the ASPX page in IE, ASP.NET generates the
error:

Name 'boMyClass' is not declared.

pointing to the line

Public boMyClass As MyClass

This forces me to compile the class (using VBC) again & again after
which only the ASPX page runs fine. Note that I didn't make any changes
in the class file (had I done that, then the class file, of course,
ought to be compiled each time any changes are made). I made changes
only in the ASPX page.

Can someone please tell me why am I encountering this error
intermittently?

Oct 14 '06 #2
Sloan, one clarification.. ...the error ASP.NET generates is

Type 'MyClass' is not defined.

& not the one that I mentioned in post #1. Sorry for the wrong
information.

Why isn't the object persisting page to page or on a postback? What
could the reason be?

I tried navigating to the link you cited in your post but I don't know
why IE always generates an error (asking me if I want to send the error
to MS) & then that IE window closes automatically. As far as using
Session objects are concerned, that would be my last option but I am
sure there must be some way out. I am keen to know the reason behind
the error.

I have been working with ASP.NET for quite some time now & this is the
first time I am encountering such an error. Any other ideas?

I use Visual Web Developer 2005 Express Edition to create & edit
ASP.NET related files.
sloan wrote:
The object does not persist page to page (or on a "postback") ... therefore
you'll need to store the object somewhere to reuse it.

..

See
http://sholliday.spaces.live.com/blog/ 10/24/2005 entry

It has a object holder for asp.net.

Or you can use the Session["key"] object.
<rn**@rediffmai l.comwrote in message
news:11******** **************@ f16g2000cwb.goo glegroups.com.. .
Using VBC, I compiled a VB class file into a DLL named MyPro.dll. The
namespace used in this class file is 'MyPro' & the public class is
named 'MyClass'. This is the ASPX page which imports the namespace &
instantiates the class 'MyClass' so that the ASPX code can invoke the
different functions existing within the class 'MyClass':

<%@ Import Namespace="MyPr o" %>

<script runat="server">
Public boMyClass As MyClass

Sub Page_Load(....)
boMyClass = New MyClass
...............
...............
End Sub

Sub MySub(....)
boMyClass = New MyClass
...............
...............
End Sub
</script>

Now what I find is though the above ASPX code works fine, on quite a
few occasions, when I make some changes in the ASPX page (not in the
class file) & then re-run the ASPX page in IE, ASP.NET generates the
error:

Name 'boMyClass' is not declared.

pointing to the line

Public boMyClass As MyClass

This forces me to compile the class (using VBC) again & again after
which only the ASPX page runs fine. Note that I didn't make any changes
in the class file (had I done that, then the class file, of course,
ought to be compiled each time any changes are made). I made changes
only in the ASPX page.

Can someone please tell me why am I encountering this error
intermittently?
Oct 14 '06 #3
Why isn't the object persisting page to page or on a postback? What
could the reason be?
Its not suppossed to. The web environment is a stateless one. unless you
use some of objects used to work (around) the statelessness.

.....

Use another browser besides IE. (firefox). The August update patch for IE,
.... kills msn sites. I'm not sure why MS doesn't get it fixed.
Sorry, but the issue is with IE, so not much I can do for you there.

...
<rn**@rediffmai l.comwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.com.. .
Sloan, one clarification.. ...the error ASP.NET generates is

Type 'MyClass' is not defined.

& not the one that I mentioned in post #1. Sorry for the wrong
information.

Why isn't the object persisting page to page or on a postback? What
could the reason be?

I tried navigating to the link you cited in your post but I don't know
why IE always generates an error (asking me if I want to send the error
to MS) & then that IE window closes automatically. As far as using
Session objects are concerned, that would be my last option but I am
sure there must be some way out. I am keen to know the reason behind
the error.

I have been working with ASP.NET for quite some time now & this is the
first time I am encountering such an error. Any other ideas?

I use Visual Web Developer 2005 Express Edition to create & edit
ASP.NET related files.
sloan wrote:
The object does not persist page to page (or on a "postback") ...
therefore
you'll need to store the object somewhere to reuse it.

..

See
http://sholliday.spaces.live.com/blog/ 10/24/2005 entry

It has a object holder for asp.net.

Or you can use the Session["key"] object.
<rn**@rediffmai l.comwrote in message
news:11******** **************@ f16g2000cwb.goo glegroups.com.. .
Using VBC, I compiled a VB class file into a DLL named MyPro.dll. The
namespace used in this class file is 'MyPro' & the public class is
named 'MyClass'. This is the ASPX page which imports the namespace &
instantiates the class 'MyClass' so that the ASPX code can invoke the
different functions existing within the class 'MyClass':
>
<%@ Import Namespace="MyPr o" %>
>
<script runat="server">
Public boMyClass As MyClass
>
Sub Page_Load(....)
boMyClass = New MyClass
...............
...............
End Sub
>
Sub MySub(....)
boMyClass = New MyClass
...............
...............
End Sub
</script>
>
Now what I find is though the above ASPX code works fine, on quite a
few occasions, when I make some changes in the ASPX page (not in the
class file) & then re-run the ASPX page in IE, ASP.NET generates the
error:
>
Name 'boMyClass' is not declared.
>
pointing to the line
>
Public boMyClass As MyClass
>
This forces me to compile the class (using VBC) again & again after
which only the ASPX page runs fine. Note that I didn't make any
changes
in the class file (had I done that, then the class file, of course,
ought to be compiled each time any changes are made). I made changes
only in the ASPX page.
>
Can someone please tell me why am I encountering this error
intermittently?
>

Oct 15 '06 #4
But, as already pointed out in post #3, today is the first time I am
experiencing this error. Never before have I encountered this error
though I have been using IE 6.0 only to test ASPX pages.

Moreover, since I am working on my local Intranet (IIS 5.0 on Win 2K
Pro), I can compile the DLL again & again whenever I encounter the
error but if I upload it on the WWW, say, www.rn5a.com, then what do
users do when they encounter this error? First of all, they won't be
able to compile it again & again since they don't know where the server
exists but, by any chance, even if they get the server & other details
(& know the VBC command to compile the class file into a DLL!), I can't
expect them to do the recompiling again & again. Other than using some
object to persist, isn't there any other way to ensure that this error
doesn't turn up?

Lastly, I discovered that recompiling the DLL using VBC doesn't always
resolve the issue & the error still gets generated. Under such
circumstances, I have to save the ASPX again (even though I haven't
made any changes to it).

Have you experienced this problem anytime? If yes, did it come up
often?
sloan wrote:
Why isn't the object persisting page to page or on a postback? What
could the reason be?

Its not suppossed to. The web environment is a stateless one. unless you
use some of objects used to work (around) the statelessness.

....

Use another browser besides IE. (firefox). The August update patch for IE,
... kills msn sites. I'm not sure why MS doesn't get it fixed.
Sorry, but the issue is with IE, so not much I can do for you there.

..
<rn**@rediffmai l.comwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.com.. .
Sloan, one clarification.. ...the error ASP.NET generates is

Type 'MyClass' is not defined.

& not the one that I mentioned in post #1. Sorry for the wrong
information.

Why isn't the object persisting page to page or on a postback? What
could the reason be?

I tried navigating to the link you cited in your post but I don't know
why IE always generates an error (asking me if I want to send the error
to MS) & then that IE window closes automatically. As far as using
Session objects are concerned, that would be my last option but I am
sure there must be some way out. I am keen to know the reason behind
the error.

I have been working with ASP.NET for quite some time now & this is the
first time I am encountering such an error. Any other ideas?

I use Visual Web Developer 2005 Express Edition to create & edit
ASP.NET related files.
sloan wrote:
The object does not persist page to page (or on a "postback") ...
therefore
you'll need to store the object somewhere to reuse it.
>
..
>
See
http://sholliday.spaces.live.com/blog/ 10/24/2005 entry
>
It has a object holder for asp.net.
>
Or you can use the Session["key"] object.
>
>
<rn**@rediffmai l.comwrote in message
news:11******** **************@ f16g2000cwb.goo glegroups.com.. .
Using VBC, I compiled a VB class file into a DLL named MyPro.dll. The
namespace used in this class file is 'MyPro' & the public class is
named 'MyClass'. This is the ASPX page which imports the namespace &
instantiates the class 'MyClass' so that the ASPX code can invoke the
different functions existing within the class 'MyClass':

<%@ Import Namespace="MyPr o" %>

<script runat="server">
Public boMyClass As MyClass

Sub Page_Load(....)
boMyClass = New MyClass
...............
...............
End Sub

Sub MySub(....)
boMyClass = New MyClass
...............
...............
End Sub
</script>

Now what I find is though the above ASPX code works fine, on quite a
few occasions, when I make some changes in the ASPX page (not in the
class file) & then re-run the ASPX page in IE, ASP.NET generates the
error:

Name 'boMyClass' is not declared.

pointing to the line

Public boMyClass As MyClass

This forces me to compile the class (using VBC) again & again after
which only the ASPX page runs fine. Note that I didn't make any
changes
in the class file (had I done that, then the class file, of course,
ought to be compiled each time any changes are made). I made changes
only in the ASPX page.

Can someone please tell me why am I encountering this error
intermittently?
Oct 15 '06 #5

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

Similar topics

0
1817
by: anonieko | last post by:
> > > > Writing an XML document the .Net way If you've been using the .Net Framework for even a week, you know that the kids in Redmond really thought of almost everything, so they're not going to make you concatenate huge strings to build an XML document. For our example, we're going to create a new page on our site called
0
6438
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to be modified: if(e.CommandName =="Print") { string parsedreceipt = null; parsedreceipt = DecodeReceipt (e.Item.Cells.Text); Session = parsedreceipt;
2
228
by: sushi | last post by:
Hello, I am developing an asp.net website. I have a web fomr say' webform1.aspx' having two input button html controls. When I click on 'button1' a message appears. Following code is executed o client side button1_click( ) { document.webform1.submit( ); }
2
3219
by: Mr Wizard | last post by:
I am going through the front controller http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpFrontControllerInASP.asp and all works well except when the server.transfer occurs. I get invalid IsPostBack results which I believe can fixed using the patch in KB:821156. How do I get this patch? Another question in the same pattern is when using LoadConrol to load a .ascx file I get "maps to another application,...
6
6141
by: =?Utf-8?B?U2FtZWVrc2hh?= | last post by:
Hi, I want to write a simple .net program to open a URL, fill in fields, and click on a button to submit it using .net 1.1 framework. Can someone help in suggesting the libraries I should use? I tried using javascript, however, I am not able to make javascript wait for the page to completely load, before trying to access and fill fields on the page. Hence resorted to .net, but not finding the right library to use.
0
2574
by: Eugene Anthony | last post by:
The problem with my coding is that despite removing the records stored in the array list, the rptPages repeater control is still visible. The rptPages repeater control displayes the navigation link (1,2,3 so on). The code can be found in SubscriptionCart.aspx.cs. Default.aspx ------------
6
5168
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick application working. However, when attempting to implement the solution, the AJAX calls weren't updating the screen like the examples were and seemed not to fire until after the long running process had completed. I found the only real...
8
8948
by: =?Utf-8?B?Q2hyaXMgSGFsY3Jvdw==?= | last post by:
Hi there I've successfully added some .NET validation controls to a page (using <asp:RequiredFieldValidator ...), however when I try to set the 'display' property to 'dynamic', my page then throws up the following error in the browser: CS1061: 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'Web' and no extension method 'Web' accepting a first argument of type 'System.Web.UI.WebControls.TextBox' could be found...
0
9485
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10161
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
10098
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,...
0
8986
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7506
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
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2890
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.