Home > Ask the Microsoft .Net Development Experts > ASP.NET and Web Development Questions & Answers > Access VB .NET Windows control on client side
Ask The Win Development Expert: Questions & Answers
EMAIL THIS

Access VB .NET Windows control on client side

Mark Belles EXPERT RESPONSE FROM: Mark Belles

Pose a Question
Other Win Development Categories
Meet all Win Development Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 08 August 2005

I have created a Windows control in VB.NET, and, using <Object> tag, placed it on an ASP.NET page. Now I want to access that control on the client side script, but I am unable to use its methods using client script.

Below is the code written for the ASP.NET page:

<HTML>
<head>
<script language="vbscript">
 function dipalyImageforView()
   cimDocImageView1.displayPicture();
 end function
</script>
</head>
 <body MS_POSITIONING="GridLayout">
  <form name="f1">
  <input type="button" name="b1" value="CLICK ME" onclick="dipalyImageforView()">
  </form>
 </body>
 <OBJECT id="cimDocImageView1" height="300" width ="300" classid ="http:DocImageViewer.dll#DocImageViewer.CimImageViewer" VIEWASTEXT>
  <param name="FilePath" value ="c:\1.tif">
  </OBJECT>
</HTML>

>
EXPERT RESPONSE

Yes, you can access embedded objects using JavaScript. You will need to refer to the object using its unique ID through the document object. You should be able to access the object using the document..method technique, or by finding the element via the document.getElementById method on the document object.

A good starting example can be found by Googling the phrase 'Javascript and Embedded Objects'. Here's a sample I found with this search that demonstrates the techniques I have mentioned: http://www.devarticles.com/c/a/JavaScript/JavaScript-and-Embedded-Objects/10/.


Do you have comments on this Ask the Expert question and response? Let us know.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
VB.NET
Converting floating values to byte form
Read data from parallel port
Converting EXE-files to VB components
Generating classes like we did in VB6
Manipulating text through VB.NET
Converting Windows applications to VB .NET
How to add a key to a listview item in VB.NET
Accessing .NET components from VBScript
How I can assign an untyped dataset to a typed dataset?
Last record in the dataset is the only one updating to the database

ASP.NET
Top ASP.NET expert advice from Danny Cazzulino
Drop down list server control creates error message
How to retrieve the MAC address of a client using ASP.NET
How to sort a dropdown list in ASP.NET
Accessing session variables in different pages
Automatically closing a .exe
Accessing a control on an independent application
Checking input by character to verify validity
Referencing an old Crystal Reports version
Redirecting results to a text file

Visual Basic .NET
Drop down list server control creates error message
Converting floating values to byte form
Datagrid issue: 'onselection' is not populating
Read data from parallel port
What is the use of these constructors?
Give me an ODBC connect, with SQL authentication
Converting EXE-files to VB components
Generating classes like we did in VB6
Manipulating text through VB.NET
Converting Windows applications to VB .NET

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice

About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2000 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts