how to reuse instance of embedded object?

J

Jim Hammond

The embedded object gets instantiated once when the page is first loaded and
then again every time the button is pressed. The user stays on this page
after pressing the button because it is not a navigation button, so I need
to reuse the same instance, but how can this be done?

<body MS_POSITIONING="GridLayout">

<OBJECT id="VideoControl"

classid="ClientSideAssembly_Video.dll#ClientSideAssembly_Video.VideoDisplay"
name="VideoControl" VIEWASTEXT>
</OBJECT>

<form id="Form1" name="Form1" method="post"
encType="multipart/form-data" runat="server" VIEWASTEXT>
<asp:button id="Button3" runat="server" Text="TAKE
PHOTO"></asp:button>
</form>

<script language="JavaScript">
function TakePicture()
{
}
</script>

</body>

I don't know if this is relevant, but I enable the button to call the
JavaScript function TakePicture() with the following C# code in the web
form:

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

Polux

Every time you click the button a new page is sent to your browser,
containing a new VideoControl object. If you don't want this, don't use
server events. Use only javascript.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top