473,504 Members | 13,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to prevent component instantiation every time?

Every time I call a method in a client-side assembly (component), it seems
like the component gets instantiated again. More specifically, I have
determined that the Init method is getting called every time. Is there a way
to preserve the initial instantiation?

Thanks,

Jim
Nov 17 '05 #1
4 1344
"Jim Hammond" <jh******@postalinnovations.com> wrote in message
news:#8**************@TK2MSFTNGP12.phx.gbl...
Every time I call a method in a client-side assembly (component), it seems
like the component gets instantiated again. More specifically, I have
determined that the Init method is getting called every time. Is there a way to preserve the initial instantiation?


Details, please?

Who is calling this client-side assembly? How is it calling the assembly
(you don't call an assembly, you call a method or property defined in a type
in the assembly, and you may instantiate an object of that type first).
--
John

Nov 17 '05 #2
Here are the details...
Thanks,

<body MS_POSITIONING="GridLayout">
<OBJECT id="Object1"

classid="ClientSideAssembly_Video.dll#ClientSideAs sembly_Video.VideoDisplay"
name="VideoControl" VIEWASTEXT>
</OBJECT>
<form id="Form3" name="Form1" method="post"
encType="multipart/form-data" runat="server" VIEWASTEXT>
<INPUT id="Hidden3" type="hidden" name="hidden1" runat="server">
<asp:image id="Image1" runat="server"></asp:image>
</form>
<script language="javascript">
function TakePicture()
{
VideoControl.TakePicture();
document.Form1.hidden1.value = VideoControl.jpgFile;
}
</script>
</body>

"Jim Hammond" <jh******@postalinnovations.com> wrote in message
Every time I call a method in a client-side assembly (component), it seems
like the component gets instantiated again. More specifically, I have
determined that the Init method is getting called every time. Is there a way to preserve the initial instantiation?


Details, please?

Who is calling this client-side assembly? How is it calling the assembly
(you don't call an assembly, you call a method or property defined in a type
in the assembly, and you may instantiate an object of that type first).
--
John


Nov 17 '05 #3
"Jim Hammond" <jh******@postalinnovations.com> wrote in message
news:uu**************@TK2MSFTNGP09.phx.gbl...
Here are the details...
Thanks,

<body MS_POSITIONING="GridLayout">
<OBJECT id="Object1"

classid="ClientSideAssembly_Video.dll#ClientSideAs sembly_Video.VideoDisplay" name="VideoControl" VIEWASTEXT>
</OBJECT>
<form id="Form3" name="Form1" method="post"
encType="multipart/form-data" runat="server" VIEWASTEXT>
<INPUT id="Hidden3" type="hidden" name="hidden1" runat="server">
<asp:image id="Image1" runat="server"></asp:image>
</form>
<script language="javascript">
function TakePicture()
{
VideoControl.TakePicture();
document.Form1.hidden1.value = VideoControl.jpgFile;
}
</script>
</body>


Jim,

I don't see where the TakePicture function is being called.

Are you saying that each time TakePicture is called the Init method of your
Object1 object is called, so that if you called it twice in a row during the
same request, you'd have Init called twice? Or are you saying that Init is
called once per request?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~

John Saunders E-mail:
jo***********@surfcontrol.com

Internet Engineer
Tel: +1 508 621 3818

WWW: www.surfcontrol.com
Fax: +1 508 621 3921

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~

SurfControl - the World's #1 Web & E-mail Filtering
Company


Nov 17 '05 #4
I left out the following button:

<asp:button id="Button3" runat="server" Text="TAKE PHOTO"></asp:button>

I enable it to call the JavaScript function TakePicture() with the following
code:

private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
Button3.Attributes.Add("onclick", "TakePicture()");
}

The init function is called once when the page is first displayed and then
each time the button is pressed.

"John Saunders" <john.saunders at surfcontrol.com> wrote in message
news:Om**************@TK2MSFTNGP12.phx.gbl...
"Jim Hammond" <jh******@postalinnovations.com> wrote in message
news:uu**************@TK2MSFTNGP09.phx.gbl...
Here are the details...
Thanks,

<body MS_POSITIONING="GridLayout">
<OBJECT id="Object1"

classid="ClientSideAssembly_Video.dll#ClientSideAs sembly_Video.VideoDisplay" name="VideoControl" VIEWASTEXT>
</OBJECT>
<form id="Form3" name="Form1" method="post"
encType="multipart/form-data" runat="server" VIEWASTEXT>
<INPUT id="Hidden3" type="hidden" name="hidden1" runat="server">
<asp:image id="Image1" runat="server"></asp:image>
</form>
<script language="javascript">
function TakePicture()
{
VideoControl.TakePicture();
document.Form1.hidden1.value = VideoControl.jpgFile;
}
</script>
</body>


Jim,

I don't see where the TakePicture function is being called.

Are you saying that each time TakePicture is called the Init method of your
Object1 object is called, so that if you called it twice in a row during the
same request, you'd have Init called twice? Or are you saying that Init is
called once per request?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~

John Saunders E-mail:
jo***********@surfcontrol.com

Internet Engineer
Tel: +1 508 621 3818

WWW: www.surfcontrol.com
Fax: +1 508 621 3921

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~

SurfControl - the World's #1 Web & E-mail Filtering
Company

Nov 17 '05 #5

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

Similar topics

3
2564
by: Alan | last post by:
Gidday people, I had a bit of a problem this morning. I think I've got it sorted now, but I wonder if anyone can shed some light. I have a plain VBS WHS file that instantiates a component that...
0
1770
by: Chad | last post by:
I have COM component embedded on html page. It has version 1.0.0.1 (by default). I have converted it in cab file. Code of html is something like: <HTML><HEAD></HEAD><BODY><OBJECT...
3
1660
by: kjon | last post by:
Hi, I've developed a couple of DLL assemblies component to be used with my main exe application. Since I need to distribute all the exe and dlls to the user PC, how can I prevent the user, who...
6
1393
by: Dave | last post by:
We have developed a few .NET components. The application access these components through well defined interface IOurInterface. The application list display name of each component in the dialog,...
2
2418
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just...
1
1648
by: Jan Svec | last post by:
Hi all, some time ago I've seen an interesting component framework for Python but I don't remember the name. I remember only one example. There were two components: Wheel and Car, Wheel were then...
5
2314
by: Slant | last post by:
Here's a question that most will have different answers to. I'm just dying to find a solution that seems halfway automated!! There really are two seperate issues which might be answered by the...
122
7209
by: Edward Diener No Spam | last post by:
The definition of a component model I use below is a class which allows properties, methods, and events in a structured way which can be recognized, usually through some form of introspection...
11
1850
by: BillGatesFan | last post by:
I have a web service which calls a .NET queued serviced component in COM+. I turned statistics on for the component. I call the component 10 times, 10 objects get created but they do not go away....
0
7298
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,...
0
7366
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...
1
7017
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...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5610
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,...
0
4698
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...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
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...

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.