静态页面我用微软Siliverlight做了个柱状图的功能,在我的机器上的IIS发布后,为什么我的机器上、局域网内都可以正常显示,但一放到服务器 上的IIS就出问题,在服务器上单独从文件夹里打开后正常显示柱状图。在IE或者IIS里浏览就什么都不显示,白板,有用过微软Siliverlight的吗?给点意见啊。谢谢 <script type="text/javascript" >
后来发现这里面的代码不执行,我的服务器是2003server.
</SCRIPT>怎么回事啊?

解决方案 »

  1.   

    网速影响。
    想办法把图片的体积降下来。你可以生成后图片后压缩为JPG
      

  2.   

    <!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>
        <title>This is my first Visifire Chart</title>
        <script type="text/javascript" src="Visifire.js"></script>
    </head>
        
    <body>
        
        <div id="VisifireChart0" align="center" style="z-index: 0;">        <script type="text/javascript" >            // Create Visifire object
                var vChart = new Visifire('SL.Visifire.Charts.xap', "MyChart", 492, 243);
                
                // vChart1.setLogLevel(0); // If you want to disable logging.
                 var styleXml = '<Canvas.Resources>'
                
                    + '    <Style  x:Key="TitleStyle" TargetType="vc:Title">'
                    + '        <Setter Property="FontColor" Value="Red"></Setter>'
                    + '    </Style>'                + '    <Style  x:Key="ChartStyle" TargetType="vc:Chart">'
                    + '        <Setter Property="Background" Value="#dbdbdb"></Setter>'
                    + '        <Setter Property="Bevel" Value="True"></Setter>'
                    + '        <Setter Property="BorderBrush" Value="Black"></Setter>'
                    + '    </Style>'
                    
                    + '</Canvas.Resources>';
                // Chart Data XML
                var chartXml = styleXml +'<vc:Chart Style="{StaticResource ChartStyle}" xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts" Width="492" Height="243" BorderThickness="0.5" Padding="3" AnimationEnabled="true" Theme="Theme1" >'
                   + '     <vc:Chart.Titles>'
                   + '         <vc:Title Text="各国控断面主要污染因子氨氮年均值(mg/l)" Style="{StaticResource TitleStyle}" FontSize="14"/>'
                   + '     </vc:Chart.Titles>'
                   + '     <vc:Chart.Series>'
                   + '         <vc:DataSeries RenderAs="Column" LegendText="平均值" >'
                   + '             <vc:DataSeries.DataPoints>'
                   + '                 <vc:DataPoint AxisXLabel="唐汉桥" YValue="14"/>'
                   + '                 <vc:DataPoint AxisXLabel="大闸"  YValue="11"/>'
                   + '                 <vc:DataPoint AxisXLabel="大套桥"  YValue="4"/>'
                   + '                 <vc:DataPoint AxisXLabel="土门楼" YValue="3"/>'
                   + '                 <vc:DataPoint AxisXLabel="三岔口" YValue="1"/>'
               + '                 <vc:DataPoint AxisXLabel="工农兵" YValue="0.8"/>'
                   + '                 <vc:DataPoint AxisXLabel="沙河桥"  YValue="0.7"/>'
                   + '                 <vc:DataPoint AxisXLabel="果河桥"  YValue="0.6"/>'
                   + '                 <vc:DataPoint AxisXLabel="临河桥" YValue="0.5"/>'
                   + '                 <vc:DataPoint AxisXLabel="于桥出口" YValue="0.5"/>'
                   + '             </vc:DataSeries.DataPoints>'
                   + '         </vc:DataSeries>'
                   + '         <vc:DataSeries RenderAs="Line" LegendText="标准值">'
                   + '             <vc:DataSeries.DataPoints>'
                   + '                 <vc:DataPoint AxisXLabel="唐汉桥" YValue="1"/>'
                   + '                 <vc:DataPoint AxisXLabel="大闸" YValue="1"/>'
                   + '                 <vc:DataPoint AxisXLabel="大套桥" YValue="1"/>'
                   + '                 <vc:DataPoint AxisXLabel="土门楼" YValue="1"/>'
                   + '                 <vc:DataPoint AxisXLabel="三岔口" YValue="1"/>'
              + '                 <vc:DataPoint AxisXLabel="工农兵" YValue="1"/>'
                   + '                 <vc:DataPoint AxisXLabel="沙河桥" YValue="1"/>'
                   + '                 <vc:DataPoint AxisXLabel="果河桥" YValue="1"/>'
                   + '                 <vc:DataPoint AxisXLabel="临河桥" YValue="1"/>'
                   + '                 <vc:DataPoint AxisXLabel="于桥出口" YValue="1"/>'
                   + '             </vc:DataSeries.DataPoints>'
                   + '         </vc:DataSeries>'
                   + '     </vc:Chart.Series>'
                   + ' </vc:Chart>';
                // Set Chart Data XML
                vChart.setDataXml(chartXml);            // Render chart
                vChart.render("VisifireChart0");
                
            </script>
            
        </div>
        
    </body></html>
      

  3.   

    你把这个vChart图片的位置暂时用一个小图片代替,看看是不是能正常显示。
      

  4.   

    vChart.render的结果应该就是图片了呀
      

  5.   

    你是说把生成图片的这两个属性改小吗?Width="492" Height="243"
    我看其它地方也没有设置的地方啊
      

  6.   

    单机在我的xp系统下的IIS不管怎么弄都正常,放在server2003上的iis上用http://127.0.0.1/xx.htm都不行,但直接进文件夹里用ie打开就行
      

  7.   

    你参考下这里,有点类似:http://topic.csdn.net/u/20100119/17/9d25c6b3-d079-48e9-bd49-48335d2cb6c5.html
      

  8.   

    找到原因。2003里用silverlight在iis里要添加MIME类型,
    .xaml                              application/xaml+xml
    .xap                                application/x-silverlight-app
    .manifest                        application/manifest
    .application                      application/x-ms-application
    .xbap                              application/x-ms-xbap
    .deploy                          application/octet-stream
    .xps                              application/vnd.ms-xpsdocument
    郁闷了两天了
    同时谢谢楼上。在asp版、IIS版跟本没人知道怎么回事
      

  9.   

    别客气。
    其实最开始我想到了MIME类型映射问题,但马上就否定了。因为我觉得微软怎么可能自己的产品不和自己的产品配套呢?加上你说在内网没问题,所以就猜是网速包括图片尺寸问题了汗~~谢谢你的分!