473,322 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to access com properties in asp.net

Hi Guys,

In my ASP.net application, I want to comunicate with DLL installed on client
machine and for that, I developed an ActiveX control in vb and incorporated
in my aspx page using Object tag.
this ActiveX control c
I am trying to access its properties by clicking on the button. I am doing
this in jscript function and calling the function on OnClick event of button,
but I am not getting any result nor I am getting any error

The object tag I have defined is

<OBJECT id="ucHWKey" style="Z-INDEX: 111; LEFT: 672px; POSITION: absolute;
TOP: 88px" classid="clsid:781D9F61-F7FA-49F6-BABC-6989022730BA"
name="ctrHWKey" VIEWASTEXT>
<PARAM NAME="_ExtentX" VALUE="8308">
<PARAM NAME="_ExtentY" VALUE="688">
<PARAM NAME="BackColor" VALUE="-2147483633">
<PARAM NAME="ForeColor" VALUE="-2147483640">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="BackStyle" VALUE="1">
<PARAM NAME="BorderStyle" VALUE="0">
</OBJECT>

whereas the script function I wrote is,

function CheckValidKey()
{
if (document.getElementById)
{
var oHK = document.getElementById("ucHWKey");
window.alert ("Checking Property");
if (oHK.IsValidKey)
window.alert ("Valid Key");
else
window.alert ("Invalid Key");
}
}

When I click on the button I get "Checking Property" alert, but not getting
any of the later alerts.

Am I doing anything wrong?
Please guide me how do I access properties of vb ActiveX control in my aspx
page

Thanks

Jeetendra
Jan 5 '06 #1
1 989
Greetings...

It's just a case of misplaced semi-colon. Try to change the code to...
function CheckValidKey()
{
if (document.getElementById)
{
var oHK = document.getElementById("ucHWKey");
window.alert ("Checking Property");
if (oHK.IsValidKey)
{
window.alert ("Valid Key"); // <-- this was the misplaced
semi-colon
}
else
{
window.alert ("Invalid Key");
}
}
}

I think it will work now.

Just for the sake of completeness, the correct if...else syntax is:

if (<test>)
<statement> | <codeblock>
[else
<statement>; | <codeblock>]

<test> ::= BOOLEAN expression evaluated as TRUE of FALSE
<codeblock> ::= { <statement> [; <statement>...] }
<statement> ::= any valid command

I hope it helps.

Regards,

PJ

Jan 5 '06 #2

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

Similar topics

8
by: Vladimir | last post by:
Hello, I have a table in MS Access database. It has one field (with BYTE datatype) that has several properties set in Lookup tab of table Design View. Display Control = Combo Box. Row Source...
8
by: William Bradley | last post by:
First of all I have been working with Access 97 and this morning the owner of the business phoned me to inform me that he had updated to Access 2000 and parts of my forms would not work anymore. ...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
6
by: Serious_Practitioner | last post by:
Good day all, and thank you in advance for your help. No - MANY thanks in advance for your help - I know nothing about using databases on Web servers. I am about to discuss a project with a...
3
by: Kent | last post by:
I am try to link a SQL 2000 table to Access 2000 using VB.Net 2003 Here is my code: Dim Con As New ADODB.Connection Dim Cat As New ADOX.Catalog Dim tbl As New ADOX.Table ...
70
by: lgbjr | last post by:
Hello All, I've been developing a VB.NET app that requires the use of a DB. Up to now, I've been using Access. It's a bit slow, but everything works. I'm at a point now where I need to decide if...
3
by: SAL | last post by:
I’m fairly new to .NET. I’ve been developing in .NET for about 6 months. I have over 10 years experience with VB in general. Here’s what I have done so far: 1. Project is entirely .NET...
17
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.