Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Sep 2011
    Location
    Frankfurt
    Posts
    4

    Beginner - Hello World in asp.net project

    Hello,

    I got the Hello World HTML client running in combination with the .Net Data adapter. The client is installed in the "LS/pages" folder.

    Now I tried to create an ASP.net web application to run this example but the page is not updating.
    Could you please help me what's the difference between running the client from the debug mode in visual studio (2015), and if it's installed directly into the LS server pages folder.

    Valid code: index.html in LS/pages:

    Code:
    <!DOCTYPE html>
    
    <!--
      LIGHTSTREAMER - www.lightstreamer.com
      Hello World Tutorial 
      
      Copyright (c) Lightstreamer Srl
        Licensed under the Apache License, Version 2.0 (the "License");
        you may not use this file except in compliance with the License.
        You may obtain a copy of the License at
           http://www.apache.org/licenses/LICENSE-2.0
        Unless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an "AS IS" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    -->
    
    <html>
      <head>
        <title>Hello World with Lightstreamer</title>
        <script src="http://cdnjs.cloudflare.com/ajax/libs/require.js/1.0.7/require.min.js"></script>
        <script src="lightstreamer.js"></script>
      </head>
    
      <body>
        <div data-source="lightstreamer" data-grid="hellogrid" data-item="greetings" data-field="message">loading...</div>
        <div data-source="lightstreamer" data-grid="hellogrid" data-item="greetings" data-field="timestamp">loading...</div>
    
        <script>
          require(["LightstreamerClient","Subscription","StaticGrid"],function(LightstreamerClient,Subscription,StaticGrid) {
            var client = new LightstreamerClient(null,"PROXY_HELLOWORLD");
            client.connect();
             
            var grid = new StaticGrid("hellogrid",true);
            
            var subscription = new Subscription("MERGE",grid.extractItemList(),grid.extractFieldList());
            subscription.addListener(grid);
            
            client.subscribe(subscription);
          });
        </script>
      </body>
    </html>

    Here's the code of the asp.net page where the grid is not updating.
    In debug mode the page is running under "local IIS" , project url: "http://localhost/LS_HelloWorld"

    Code:
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="default.aspx.vb" Inherits="LS_HelloWorld._default" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <script type="text/javascript" src="js/require.js"></script>
        <script type="text/javascript" src="js/lightstreamer.js"></script>
        <script type="text/javascript"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>My LS Hello World</title>
    </head>
    
    <body>
        <form id="form1" runat="server">
        <div data-source="lightstreamer" data-grid="hellogrid" data-item="greetings" data-field="message">loading...</div>
        <div data-source="lightstreamer" data-grid="hellogrid" data-item="greetings" data-field="timestamp">loading...</div>
        <script>
          require(["LightstreamerClient","Subscription","StaticGrid"],function(LightstreamerClient,Subscription,StaticGrid) {
            var client = new LightstreamerClient(null,"PROXY_HELLOWORLD");;
            client.connect();
            
            var grid = new StaticGrid("hellogrid",true);
            
            var subscription = new Subscription("MERGE",grid.extractItemList(),grid.extractFieldList());
            subscription.addListener(grid);
            
            client.subscribe(subscription);
          });
        </script>    
        </form>
    </body>
    </html>

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi Michael,

    I think that in your case the problem is in the create call for LightstreamerClient.
    Please note that the Lightstreamer Server address could be not required only when the front-end pages are supplied by Lightstreamer Server itself (although this scenario is advised only for demo purpose).

    If the front-end pages are provided by a web server other than Lightstreamer, in your case IIS, you have to provide the URL of Lighstreamer server.
    For example if you're still using the factory configuration:



    Anyway please refer to this demo as an example of the Lightstreamer JavaScript client library running inside Visual Studio.

    Regards,
    Giuseppe

  3. #3
    Member
    Join Date
    Sep 2011
    Location
    Frankfurt
    Posts
    4
    This solved it. Thanks.

 

 

Similar Threads

  1. Integrate Hello World sample in stand alone ASP.NET
    By Don_Go in forum Adapter SDKs
    Replies: 7
    Last Post: September 12th, 2013, 10:25 AM
  2. Hello World Error
    By jaguarg in forum Adapter SDKs
    Replies: 2
    Last Post: November 5th, 2008, 09:38 PM
  3. "Hello World" Data Adapter [.NET]
    By Alessandro in forum Adapter SDKs
    Replies: 3
    Last Post: May 30th, 2008, 02:49 PM
  4. "Hello World" Data Adapter [Java]
    By Alessandro in forum Adapter SDKs
    Replies: 0
    Last Post: February 13th, 2008, 11:12 AM
  5. beginner question
    By dianacastillo in forum Adapter SDKs
    Replies: 1
    Last Post: January 17th, 2008, 11:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 11:53 AM.