-
February 1st, 2008, 03:30 PM
#1
ASP.NET error.Please Help
I am a new to lightstreamer. I developing a .ASPX page to receive stream data from JMS.
These are the steps I am following, but I get the error
"ER add Table Cant add table is PusgPage is not bound. Please call the bind() method of PushPage before adding tables"
Please tell me what I am doing wrong.
1) open a aspx project.
2) This is my code for the default.aspx page.
3) I publish this website to c:\inetpub\wwwwroot.
4) My lightsreamer.conf has the http port as 80
5) when I use the URL http://localhost/AMSDemo/Default.aspx, i get the above error.
Please help
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Dataware AJAX Messaging Service Demo</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="ls/lscommons.js"></script>
<script language="JavaScript" src="ls/lspushpage.js"></script>
<script language="JavaScript">
///////////////////block escape key
document.onkeydown = checkEscape;
document.onkeypress = checkEscape;
function checkEscape(e) {
if(!e) e = event;
if(e.keyCode == 27) return false;
}
//////////////////PushPage/Engine Config
var lsPage = new PushPage();
var debugAlerts = true;
var remoteAlerts = false;
var pushHost = "localhost";
lsPage.context.setDomain(localhost);
lsPage.context.setDebugAlertsOnClientError(debugAl erts);
lsPage.context.setRemoteAlertsOnClientError(remote Alerts);
lsPage.onEngineCreation = function(engRef) {
engRef.context.setDebugAlertsOnClientError(debugAl erts);
engRef.context.setRemoteAlertsOnClientError(remote Alerts);
engRef.policy.setMaxBandwidth(30);
engRef.policy.setIdleTimeout(30000);
engRef.policy.setPollingInterval(1000);
engRef.connection.setLSHost(pushHost);
engRef.connection.setLSPort(80);
engRef.connection.setAdapterName("STOCKJMS");
engRef.changeStatus("STREAMING");
}
lsPage.bind();
lsPage.createEngine("SLEngine","ls/","SHARE_SESSION");
</script>
</head>
<body>
<table class="demoTitle" style="width:100%">
<tr>
<td><img style="border-width:0" src="images/TRO.gif" /> </td>
<td><div class="demoTitle">Lightstreamer ASP.NET AJAX Demo With Datatware</div></td>
</tr>
</table>
<form id="form1" runat="server">
<table style="width:100%">
<tr>
<td class="stockTD"><div source="lightstreamer" table="1" item="1" field="1">-</div></td>
<td class="stockTD"><div source="lightstreamer" table="1" item="1" field="2">-</div></td>
<td class="stockTD"><div source="lightstreamer" table="1" item="1" field="3">-</div></td>
</tr>
<script language="JavaScript">
var lsTable = new OverwriteTable(null, null, "MERGE");
lsTable.setRequestedMaxFrequency(1);
lsTable.setSnapshotRequired(true);
lsPage.addTable(lsTable,"1");
</script>
</table>
</form>
</body>
</html>
-
February 4th, 2008, 09:11 AM
#2
Hi,
I assume that "http://localhost/AMSDemo/Default.aspx" is a typo as this url does not have a port and you said you have Lightstreamer on port 80 (so your IIS must listen to a different port)
If you're using two servers (ie Lightstreamer + Web Server) you can no longer use "localhost" to reach your pages but you should use a complete machine name (e.g.: mypc.mydomain.com) and your code should change accordingly:
Btw your error does not seem to be related to this problem. Maybe your problem is the following line:
do you have a variable called localhost? If not this line will throw an exception so that the entire block is skipped (including the bind call) and the addTable (that's in another block) is executed before the bind as the message states.
HTH
-
February 4th, 2008, 02:13 PM
#3
That helped
It works now. Thank you so much. I really appreciate it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 10:46 AM.
Bookmarks