This project is read-only.

ASP.NET (VB.NET) WEB_FORM DateTime issues!

Feb 26, 2014 at 8:09 PM
Edited Feb 26, 2014 at 8:13 PM
Hi,

I red most of the discussions in here about VB.NET. I created my asp.net web form project.
For testing purpose I have only defaulf.aspx page. In default.vb I have;
Imports DotNet.Highcharts
Imports DotNet.Highcharts.Options
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports DotNet.Highcharts.Enums
Imports System.Drawing
Imports System.Collections.Generic

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim kurAdapter As New DovizTableAdapters.KurFiyatTableAdapter
        Dim dt As DataTable
        dt = kurAdapter.GetByKurIDByDate("2014-02-25", 1)

        Dim series As Series() = New Series(dt.Rows.Count - 1) {}
        For i As Integer = 0 To dt.Rows.Count - 1
            series(i) = New Series() With { _
                .Name = dt.Rows(i)("Alis").ToString(), _
                .Data = New Helpers.Data(New Object() {dt.Rows(i)("HourMinuteSecond")})}
        Next

        Dim chart As New Highcharts("chart")
        chart.SetSeries(series)

        Dim LTKB_NESC As String
        LTKB_NESC = chart.ToHtmlString()
        Dim k As Integer = 5
    End Sub

End Class
I use this; "Dim k As Integer = 5" as debugging purpose. When I debug on "Dim LTKB_NESC As String" line I can see data as 08:17:10 (Hour.Minute:Second) and Name as "2.853" as an decimal values. Till there everything works perfectly. Then I debug on "Dim k As Integer = 5" lines in QuickWatch I get this;
LTKB_NESC   "<div id='chart_container'></div>  <script type='text/javascript'>  var chart;  $(document).ready(function() {   chart = new Highcharts.Chart({    chart: { renderTo:'chart_container' },     series: [{ data: [2.2090], name: '08:17:05' }, { data: [2.2090], name: '08:17:21' }, { data: [2.2090], name: '08:18:02' }, { data: [2.2020], name: '08:42:00' }, { data: [2.2100], name: '09:27:08' }, { data: [2.2120], name: '09:44:07' }, { data: [2.2030], name: '10:01:43' }, { data: [2.2090], name: '10:32:03' }, { data: [2.2050], name: '10:57:15' }, { data: [2.1940], name: '12:31:33' }]   });  });  </script>  " String
Look like it seems everything fine. And my default.aspx page I have;
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!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" lang="tr">
<head runat="server">
    <title>LTKB Live</title>
    <link href="Styles.css" rel="Stylesheet" type="text/css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script>
    <script type="text/javascript" src="http://code.highcharts.com/modules/exporting.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <h1> Daily Analytic</h1>
        <asp:Literal id="LTKB_NESC" runat="server"></asp:Literal>
    </div>
    </form>
</body>
</html>
When I run I can see only my Title as "LTKB Live" and above top of the page I can see read line and nothing else. Somewhere I made it wrong typing and I cannot figured out.

I will be glad if anyone can show my mistake that I can run page correctly.

Kind Regards,
NTMS