Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

webform

Solved!
Go to solution

Hello,

 

I developped a website with Measurement Stuido. Everything is OK in the VS environment. But if I use web brower to visit the website, I can NOT see the image of the controls, but only a red cross picture.

 

For example:

 

 

 Correct, by using VS debug

correct.JPG

 

Error, by using IE directly

error.JPG

 

What's wrong?

 

My development enviornment:

 

MS: Measurement Studio 8.6 for VS 2008 

Tools: VS 2008

Language: C# .net

Web Server: IIS 7

OS: Windows Vista

Web browser: IE8

 

Thank you very much.

 

Chang CAI

2009-8-4

0 Kudos
Message 1 of 8
(6,666 Views)

Maybe it is the setting of the browser cause this problem. Also it would be convenient if you can attach your code.

District Sales Manager | Shanghai Pudong, China
0 Kudos
Message 2 of 8
(6,654 Views)

Thanks for your reply.

The codes is very simple as follows:

 

1. Default.aspx

 

-------------------------------------------

 

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register assembly="NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a" namespace="NationalInstruments.UI.WebForms" tagprefix="ni" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <ni:Led ID="Led1" runat="server" />
   
    </div>
    </form>
</body>
</html>

-------------------------------------------------------

0 Kudos
Message 3 of 8
(6,636 Views)

2. licenses.licx 

 

------------------------------------------

 

NationalInstruments.UI.WebForms.Led, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
# The following section of this file was autogenerated by Measurement Studio.  Do not edit or remove this file from the project.
# This file is used for licensing Measurement Studio components.
# Begin Measurement Studio licenses
NationalInstruments.NetworkVariable.WebForms.NetworkVariableDataSource, NationalInstruments.NetworkVariable, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.NetworkVariable.NetworkVariableLicenser, NationalInstruments.NetworkVariable, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.NetworkVariable.WindowsForms.NetworkVariableBrowserDialog, NationalInstruments.NetworkVariable, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.NetworkVariable.WindowsForms.NetworkVariableDataSource, NationalInstruments.NetworkVariable, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.Slide, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.Thermometer, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.ScatterGraph, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.Gauge, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.ComplexGraph, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.DigitalWaveformGraph, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.NumericEdit, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.Knob, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.AutoRefresh, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.Switch, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.WaveformGraph, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.Meter, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.Tank, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
NationalInstruments.UI.WebForms.Legend, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
# End Measurement Studio licenses

---------------------------------------

0 Kudos
Message 4 of 8
(6,635 Views)

This is almost certainly caused because your image is not located in the correct directory. Looking at your asp code I cannot tell where it needs to be but check to make sure that it is in the path that your web server expects it to be in.

 

Regards,

 

Steven Zittrower

Applications Engineer

National Instruments

http://www.ni.com/support

0 Kudos
Message 5 of 8
(6,617 Views)

Hello, thanks for your help. I think you are right.

 

The image property is as follows: That shows the axd can not be visited. 

 

property.JPG

 

 

I had add the httpHandler path centence into the web.config file.

 

For example:

---------------------------

    <httpHandlers>
      <add path="ImageStateHandler.axd" verb="GET" type="NationalInstruments.UI.WebForms.ImageStateHandler, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a" validate="true" />
    </httpHandlers> 

 --------------------------

 

But how to put the correct path? Add the NI webform control dll files to application \Bin\ directory? Or add those dll files to IIS settings?

 

Pls. advise.

 

Thank you very much.

 

Chang CAI

2009-8-8

0 Kudos
Message 6 of 8
(6,612 Views)
Solution
Accepted by topic author deeper

I think, you are seeing this because IIS7 does not look at some sections in the web.config when you do a simple copy-website from the VisualStudio.

 

The images are not being shown in the client, because it is missing the http handler mapping in the server. [This would bepicked up in IIS6 or earlier from the web.config, but not by default in IIS7, I think].

 

To fix this, you could manually add this handler mapping to your web-application in IIS7. To do this, on Vista:

 

  1. Launch the IIS Manager ("inetmgr.exe" in the Win+R Run dialog)
  2. Under Connections, Expand the sites and select your application. (For ex: Sites-> Default Web Site -> MyWebApp)
  3. On the right side, double-click on the "Handler Mappings" (located under IIS category)
  4. You'll see a bunch of configured handler mappings. You'll need to ensure that the handler mapping that was defined in the web.config for ImageStateHandler.axd is presenthere. if not, you can add it by
    1. Right-click this area and select "Add Managed Handler"
    2. On the Add manged Handlerdialog, provide these values:
      1. for Request path: ImageStateHandler.axd
      2. for Type: NationalInstruments.UI.WebForms.ImageStateHandler, NationalInstruments.UI.WebForms, Version=8.6.35.189, Culture=neutral, PublicKeyToken=18cbae0f9955702a
      3. Name: NI ImageState Handler
      4. Press OK.

 

Now, you should be able to see the images. Let me know if this did not solve the issue for you.

 

Please look at ASP.NET Integration With IIS 7.0 [on iis.net] for some more information.

 

 

Update: Added the missing link

Message Edited by mherle on 08-10-2009 11:37 AM
-Mahesh
National Instruments
0 Kudos
Message 7 of 8
(6,581 Views)

Dear Mahesh,

  

It is done! Amazing!

 

Thank you very much! You are a real expert.

 

Chang CAI

2009-8-10

0 Kudos
Message 8 of 8
(6,570 Views)