how to reuse instance of embedded object?

  • Thread starter Thread starter Jim Hammond
  • Start date Start date
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()");
}
 
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.
 
Back
Top