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:
<!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"
<%@ 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>