How to access the properties and methods of the ActiveX control on the client side in Web Form using javascript or vbscript

Hi All,

I have looked almost every where for this, and I'll be really appreciated if someone can help me with this. I found a article in MS KB article, #317392, but it is not extactly what I wanted.
How do you reference an ActiveX control's methods and properties with javascript in the ASPX?
Following is what I have. Some how the following line in the btnclick() does not seems to be working.
AlarmCtl.StartTimer()
I have done this with just .HTML and it works just fine.
Can any one help. Thanks in advance.

//===============================================
<HEAD>
<title>WebForm1</title>
<script language="javascript">

function btnclick()
{
AlarmCtl.StartTimer()
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<OBJECT id="AlarmCtl" height="33" width="120"
classid="clsid:D2341156-6537-11D2-9049-444553540000" IEWASTEXT> <PARAM NAME="_ExtentX" VALUE="3175">
<PARAM NAME="_ExtentY" VALUE="873">
<PARAM NAME="CountDown" VALUE="-1">
<PARAM NAME="AlarmTime" VALUE="12:00:00 AM">
</OBJECT>
<INPUT type="button" value="Button" onclick="btnclick()"> </form>
</body>
</HTML>
0
yenchen007
12/30/2003 1:23:15 AM
asp.net.client-side 24353 articles. 2 followers. Follow

2 Replies
1867 Views

Similar Articles

[PageSpeed] 36

//=============================================== 

<HEAD>
<title>WebForm1</title>
<script language="javascript">
function btnclick()
{
document.all.AlarmCtl.StartTimer()
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<OBJECT name="AlarmCtl" id="AlarmCtl" height="33" width="120"
classid="clsid:D2341156-6537-11D2-9049-444553540000" IEWASTEXT> <PARAM NAME="_ExtentX" VALUE="3175">
<PARAM NAME="_ExtentY" VALUE="873">
<PARAM NAME="CountDown" VALUE="-1">
<PARAM NAME="AlarmTime" VALUE="12:00:00 AM">
</OBJECT>
<INPUT type="button" value="Button" onclick="btnclick()"> </form>
</body>
</HTML>



try this codes.
0
poiznkorea
12/30/2003 3:54:19 AM
poiznkorea,


Thanks for your input. I gave it a try in the ASPX, but it still does not work. I got an error message that says the following.
"Microsoft JScript runtime error: Object doesn't support this property or method."
As I was typing the line in, the code complete does not even have "document.all" property.
Your further input are very welcome.

Thanks again,
Yen
****************************************************
Following is what I have in my ASPX file. (I am doing this with .NET)
****************************************************
<%@ Page SmartNavigation="true" Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="WebAppActiveX2.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<SCRIPT language="javascript">
function btnClick()
{
document.all.AlarmCtl.StartTimer()
}
</SCRIPT>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<OBJECT id="AlarmCtl" height="33" width="120"
classid="clsid:D2341156-6537-11D2-9049-444553540000" VIEWASTEXT>
<PARAM NAME="_ExtentX" VALUE="3175">
<PARAM NAME="_ExtentY" VALUE="873">
<PARAM NAME="CountDown" VALUE="-1">
<PARAM NAME="AlarmTime" VALUE="12:00:00 AM">
</OBJECT>
<INPUT type="button" value="Button" onclick="btnClick()"></TD>
</form>
</body>
</HTML>


0
yenchen007
12/30/2003 7:33:30 AM
Reply:

Similar Artilces:

Access web form content from client side HTML file using javascript
I have two browser windows open, one an html file residing on the client and one an aspx page served up by the web server. Neither window is related to the other; neither one opened the other. Is it possible for javascript on the html file which resides on the user's local computer to "read" any of the information from the other open window? Ideally, I'd like to read a hidden input field from the web page. The solution only has to work in IE 6 and 7. Thanks in advance. Man, this sounds more like a virus, like spyware... Why do you need to do such thing? What I want is to open ne...

How to call web method directly form client side javascript without using hta file
Hello nice guys, I am a newbie in this forum. I need to be able to call a web service from client side javascript code without using webservices.hta file so it may work on Netscape browsers as well as IE browsers. I don't mind having to form soap request and then post it all in javascript. An example will be very helpful. Do you have any resource I may look up to, like any published article on the net, for code examples or a work around. Thanks Dean51 Hi, I wrote a library to use AJAX to consume Web Services. You can find the article, the source code (less than 8 KB) and some...

How to access all the methods of server controls and infragistics controls from client-side javascript.
I have some web controls on my page, which i want to manipulate without going to the server, that is, from a client-side javascript. I know how to call them with the documents.forms.... but i do not know how to call their methods. For the text box, the method to manipulate it is 'value'. It's a property i think. for the html <select> it is the 'options' array. But for the others, I dont know.My question is the following:I have an infragistics control: the UltraWebTree.This is its code in html: <ignav:ultrawebtree id="UltraWebTree1" style="Z-INDEX: 108; LEFT: 352p...

How to access dynamically Html controls (client side controls) using C# server side scripts
Folks,I have problem try to to access dynamically Html controls (client side controls) using C# server side scripts. Please give me helps.     The error is as follows Exception Details: System.InvalidCastException: Specified cast is not valid.Source Error: Line 79: { Line 80: Control c = Page.FindControl("ddlTC" + i); Line 81: ((DropDownList)c).DataSource = mdt; Line 82: ((DropDownList)c).DataTextField = "ClassID"; Line 83: ((DropDownList)c).DataValueField = "Course"; My aspx page source codes: ...<...

differences between server side asynchronous Web methods and client side asynchronous Web methods
Hi,   can anyone expalin what are the differences between server side asynchronous Web methods  and client side asynchronous Web methods in ASP.Net 2.0 ?   any best articles on serverside asynchronous Web methods  ?   Thanks,  hi, check this url, Server-Side Asynchronous Methods for ASP.NET, http://www.codeproject.com/KB/cpp/asyncws.aspx   Calling the Server-Side method asynchronously from Client Script, http://www.c-sharpcorner.com/UploadFile/dipenlama22/Callbacks07182006093320AM/Callbacks.aspx...

How to write data to a file in client side using javascript or someother client side scripting language.
Hi, I would like to know how to write a data to a client side file using javascript or someother client side scripting language. The file type expected is ini file. txt file would also be appreciable. Thanks in advance.   If the site is a trusted and you are running IE then you could try http://www.w3schools.com/asp/asp_ref_filesystem.asp The Old Sewing FactoryThat twitter nonsense. You can write to the server, but not to the client's machine.  Being able to do so would be a huge security breach.When you ask a question, remember to click "mark as answered"...

Accessing server-side control in client-side javascript function; on Content page
I am trying to set an asp:textbox value in the Client side javascript function. It works fine on the standalone page. But when i try to do this the Content page, it’s giving the follwoing error message. document.getElementByID[...] is null of not an object  Any idea? Thanks, Riz   Hi, are you using ClientID property of that server control, to get its ID (which is rendered at the client and can be used with document.getElementById )?Thanks,Teemu KeiskiFinland, EU Thank you my problem is solved....

Disabling a TextBox web control using javascript (client-side)
I'm using two textboxes and one button for a C# .NET web app code: <form id="Form1" method="post" runat="server"> <asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 248px; POSITION: absolute; TOP: 128px" runat="server"></asp:TextBox> <asp:TextBox id="TextBox2" style="Z-INDEX: 102; LEFT: 248px; POSITION: absolute; TOP: 168px" runat="server"></asp:TextBox> <asp:Button id="Button1" style="Z-INDEX: 103; LEFT: 248px; POSITION: absolute; TO...

In datawindow.net,access the database from client side event using javascript
In powerbuilder,for example,a datawindow has two columns:itemno,description. input an itemno,validate it.if not found from the database,return 1 to trigger itemerror event; if found,get the description of the item from the database,and fill it into the column "description". The question is how to fulfill the function in web datawindow,through web service? if so,I need an example to realize it. You will need to use AJAX or make a round trip on item change event. -- Dean Jones CEO PowerObjects http://www.powerobjects.com (612) 339-3355 Ext. 112 TeamSybase * *...

How to Access/Pass Server Side Array Variable at Another Web Form's Client Side
Hi All,I struck up with some intrested senario at my application development...hope some body will guide me or sends me some code snippets....Thanks in advance.Senario is like this.....in A.aspx (using C# .net 2.0 as code behind) I am going to have a array variable basically it is an TWO Dimensional array after populating the values in array I need to redirect/ reload another web form B.aspx, here i need to access the array in B.aspx client side JavaScript.How can I do this...Thanks AgainRaju Dont do a redirect but use server.transfer. That way the previous page will still hold its value, ...

Question re: accessing web control values via client-side javascript
This block of variables gets generated dynamically from my _PreRender event of my formView : <SCRIPT Language='JavaScript'>  var chkInvertAliasID = 'ctl00_ContentPlaceHolder1_FormView1_chkEditInvert';  var chkAct_CurAliasID = 'ctl00_ContentPlaceHolder1_FormView1_chkEditAct_Cur';  var radBuy_SellAliasID = 'ctl00_ContentPlaceHolder1_FormView1_radioEditBuySell'; </SCRIPT> Now on the client-side I get a handle to above-declared var's : function QuoteConvention(obj) {         var objChkInvert = document.getElementById(chkInv...

To use a Gridview .V. Client Side Javascript to allow user controlled list on a form.
Hi,I want to add functionality to a form and im not sure how to represent it.This functionality consists of the user being able to add and remove values from a list. Each item in the list would ideally be represented two textboxes, one for the title and one for its content. When the form loads initially there will be two empty checkboxes available, one for title, and one for value. They should then be able to add and remove list items not including the first.I was thinking of loading the page and using javascript to allow the user this functionality but was wondering if there was some obviou...

List of client side function of extenders and controls for client side
Hello All,I am using AJAX control toolkit for my current project. Now I need to find out what client side functions I can call on an extender. Lets say I am using a PopControlExtender. Now I want to show the popup from a JS funtions.If I can do a guess then it would be something like this$find('ppce').show();From where I can find what client side functions I can call on those extensders. This is really a frusterating thing. I learn about extenders only from Learn tutorials, no help here and there. Can anybody please tell me where are documentations about all the extenders in the tool...

How to use client-side script(javascript) in DNA using .Net Remoting
Hi all,     It was known that SAO and Singleton object about .Net Remoting. When I Create an object in server side and hosting in IIS's virtual directory,I want to use javascript asynchronous invoking the remote object by HTTP channel, 80 port and SOAP formatter just like XMLHTTP invoking web service. My code as following, <script> objXmlDoc = new ActiveXObject("Msxml2.DOMDocument"); objHttp = new ActiveXObject("Msxml2.XMLHTTP"); strEnvelope = ?? objHttp.onreadystatechange = function() { ...... }   szUrl = "http://ServerNa...

Web resources about - How to access the properties and methods of the ActiveX control on the client side in Web Form using javascript or vbscript - asp.net.client-side

Properties of water - Wikipedia, the free encyclopedia
This article is about the physical and chemical properties of pure water. For general discussion and its distribution and importance in life, ...

Facebook Surpasses All Google Properties In Brazil
Facebook overtook Orkut to became Brazil’s top social network in January, but has only overtaken all of Google’s properties in that nation just ...

Extended Profile Properties - Facebook-Entwickler
These Permissions cannot be revoked in the Login Dialog during the login flow, meaning they are non-optional for Users when logging into your ...

PortPerry Properties (@brian14mckinlay) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Hawaii Real Estate Properties on the App Store on iTunes
Get Hawaii Real Estate Properties on the App Store. See screenshots and ratings, and read customer reviews.

32 properties resumed to start Kingsford Smith Drive widening project
Hundreds of residents and businesses along Kingsford Smith Drive &ndash; one of Brisbane's busiest roads &ndash; are about to feel the pressure ...

Properties pass in as 1000 auctions unfold after last week’s Melbourne Cup lull
Melbourne's declining real estate clearance rate was reflected by mixed auction results on Saturday.

One missing as bushfire threatens properties north of Lancefield, central Victoria
UPDATE: AN elderly man is missing as crews work to protect rural properties under threat from a 3000ha bushfire that continues to burn out of ...

Golden Mile a 'basketcase' as commercial properties lose value
Kings Cross will never again function as Sydney's late-night entertainment precinct, property owners say, with residential developers snapping ...

Lancefield bushfire: Home destroyed, properties under threat as bushfire burns in central Victoria
... in a fire burning out of control near Lancefield in central Victoria, the Country Fire Authority (CFA) says, warning that other homes and properties ...

Resources last updated: 11/26/2015 6:09:31 AM