Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

asp.net design question

Posted on 2005-05-05
20
Medium Priority
?
552 Views
Last Modified: 2013-11-25
hello experts,
i am developing an asp.net application.  i am new to asp.net and need to know how to get started implementing my conceptual design.  first, when the user opens a browser and navigates to the web app he will be presented with a login screen.  upon successfull login the application is going to present the user with a spreadsheet embedded into the page in the browser.  below the spreadsheet will be a button that when clicked will try to locate on the client's box a program called AccuTerm.  once an accuterm session has successfully been initialized the application will pass data from the embedded spreadsheet to the accuterm session using accuterm's api. so basically there will be a server side component that posts the spreadsheet data to the users browser and a client side component that will consume the spreadsheet data.  is it possible to manipulate the clients computer i.e. accuterm through asp.net?
thanks
0
Comment
Question by:comppgmr
  • 10
  • 7
  • 2
  • +1
20 Comments
 
LVL 23

Expert Comment

by:b1xml2
ID: 13937878
Unless it is within an intranet, and the client is loading an approved ActiveX Component (meaning it will have installed it, or you have added in the HTML attributes the location for the cab files) and the appropriate "loosening" of security is effected, the plain answer is NO.

Any manipulation within a client's computer cannot and should not be able to take place without the knowledge and consent of the end-user. Otherwise, the browser has a major security breach.
0
 
LVL 7

Expert Comment

by:rohanbairat3
ID: 13938237
Yes I agree with b1xml2.

 The client side component cannot run on a browser for your kind of purpose. But what you can do it write a windows app. which will do the things for you. A smart Client or a regular rich client can get the task done. The user has to go thru your S/w instead of Browser.

-Rons
0
 

Author Comment

by:comppgmr
ID: 13939454
the application is within an intranet.  all users will have the accuterm application. the web browser is really the only option that I have at this point.  can i do something like vbscript on the client side to do what i have proposed?
0
Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

 
LVL 7

Expert Comment

by:rohanbairat3
ID: 13939740
You need to write an ActiveX component in that case.... You need to install this component on each machine... I am myself looking for solutions to download ActiveX automatically from broswer. I have an ActiveX component that reads video stream from a WEB CAM ...

So its possible... but i cant help u with the installation part...

-Rons
0
 
LVL 33

Expert Comment

by:raterus
ID: 13940340
http://msdn.microsoft.com/msdnmag/issues/02/01/UserCtrl/default.aspx

Here is an article on using client-side .net programs from within a webpage.  I've never done this though, but I feel that is what you should be concentrating on right now, if you must do this in a webpage.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 13941591
If the software mentioned has COM interfaces, which it should, you can instantiate it client-side. What you can do is use VBScript as oppose to Javascript. COM Automation does not always work well with Javascript as it does with VBScript



e.g.
Dim oSoftware
Set oSoftware = CreateObject("Yadda.dada")

You get the appropriate progid. Check with the software vendor
0
 

Author Comment

by:comppgmr
ID: 13944437
b1xml2,
I tried your example but it did not launch the AccuTerm application.  Below is the code that I put in the html section of the WebForm1.aspx.  What do you think could be the problem?

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="CommissionGrid.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
  <HEAD>
    <title>Commission Plan</title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    <meta content="VBScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    <script language="vbscript" id="clientEventHandlersVBS">
sub button1_onclick()
    Dim oApp As AccuTerm
    oApp = CreateObject("AccuTermClasses.AccuTerm")
    MsgBox(oApp.ProductName)
end sub
    </script>
  </HEAD>
  <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
      <asp:button id="Button1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server"
        Text="Button"></asp:button>&nbsp;
    </form>
  </body>
</HTML>
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 13944475
permissions, set the permissions appropriately to allow the instantiation of the ActiveXObject
0
 
LVL 23

Accepted Solution

by:
b1xml2 earned 2000 total points
ID: 13944505
Tools --> Internet Options --> Security --> Trusted Site
1. Uncheck the "Require server verification..." check box
2. Add your web site to the list of trusted sites. e.g. http://myservername
3. Click OK
4. In security tab, click on Custom Level.
5. Set everything to enable.
6. Click OK

try out the instantiation of the object
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 13944513
Next to launch it
============
<input type="button" onclick="button_onclick()" language="vbscript" value="Button" />
0
 

Author Comment

by:comppgmr
ID: 13944602
do i do that in ie?
0
 

Author Comment

by:comppgmr
ID: 13944615
ok, ill try that and report back.  thanks for such a prompt response.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 13944667
change to
Sub Button_OnClick()
...
End Sub
0
 

Author Comment

by:comppgmr
ID: 13944777
i made the changes you suggested but the status bar in ie says Error in page and nothing happens.  here is the modified code:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="CommissionGrid.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
  <HEAD>
    <title>Commission Plan</title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    <meta content="VBScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    <script language="vbscript" id="clientEventHandlersVBS">
      Sub Button_OnClick()
          Dim oApp As AccuTerm
          oApp = CreateObject("AccuTermClasses.AccuTerm")
          MsgBox(oApp.ProductName)
      End Sub
    </script>
  </HEAD>
  <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
      <input type="button" onclick="button_onclick()" language="vbscript" value="Button" />
    </form>
  </body>
</HTML>
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 13944886
change your VBScript
=============
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <script language="vbscript" id="clientEventHandlersVBS">
      Sub Button_OnClick()
          Dim oApp
          Set oApp = CreateObject("AccuTermClasses.AccuTerm")
          MsgBox(oApp.ProductName)
      End Sub
    </script>

0
 
LVL 23

Expert Comment

by:b1xml2
ID: 13944889
ignore the DocType thingy!
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 13944905
If you want more robust code

Sub Button_OnClick()
      On Error Resume Next
      Dim oApp
      Set oApp = CreateObject("AccuTermClasses.AccuTerm")
      If oApp Is Nothing Then
            MsgBox("ActiveX Component Could Not Be Created")
      Else
            MsgBox(oApp.ProductName)
      End If
      
End Sub
0
 

Author Comment

by:comppgmr
ID: 13945050
i am still getting the "Error in page" message.  what is wierd is that i can put just a messagebox command in the sub and it will show the messagebox but as soon as i try to create an object it does nothing.  also am i putting this code in the correct spot?  in vs.net for a webform there are two tabs(Design and HTML).  i am putting this code in the HTML tab code.  I also tried it using excel.

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="CommissionGrid.WebForm1"%>
<HTML>
  <HEAD>
    <title>Commission Plan</title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    <meta content="VBScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    <script language="vbscript" id="clientEventHandlersVBS">
      Sub Button_OnClick()
        On Error Resume Next
        Dim oApp
        Set oApp = CreateObject("Excel.Application")
          If oApp Is Nothing Then
            MsgBox("ActiveX Component Could Not Be Created")
          Else
            MsgBox(oApp.Name)
          End If
      End Sub
    </script>
  </HEAD>
  <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
      <input type="button" onclick="Button_OnClick()" language="vbscript" value="Button">
    </form>
  </body>
</HTML>
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 13945153
have you done the permissions thingy and access the page you just created from a web server??? (local one of course)
0
 

Author Comment

by:comppgmr
ID: 13958511
b1xml2,
i got it to work.  turns out i had the class name wrong in the createobject method.  it took me a while to figure that out as it was named something different in the object browser than what was actually required.  thanks for your help.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question