为什么完整的日历不会出现在asp.net中?

时间:2017-08-08 04:44:41

标签: asp.net asp.net-web-api fullcalendar fullcalendar-scheduler

当我使用MySQL服务器时出现问题,日历出现但是当我更改与SQL服务器的连接时,日历不会出现。我不知道如何解决这个问题。是否有必要更改代码才能显示日历?

HTML:

<script type="text/javascript">
    function Confirm() {
        var confirm_value = document.createElement("INPUT");
        confirm_value.type = "hidden";
        confirm_value.name = "confirm_value";
        if (confirm("Do you want to proceed ?")) {
            confirm_value.value = "Yes";
        } else {
            confirm_value.value = "No";
        }
        document.forms[0].appendChild(confirm_value);
    }
</script>

<script type="text/javascript">
    function ConfirmEvent() {
        var confirm_value_event = document.createElement("INPUT");
        confirm_value_event.type = "hidden";
        confirm_value_event.name = "confirm_value_event";
        if (confirm("Do you want to proceed ?")) {
            confirm_value_event.value = "Yes";
        } else {
            confirm_value_event.value = "No";
        }
        document.forms[0].appendChild(confirm_value_event);
    }
</script>

<style type="text/css">
    .style1 {
        font-weight: bold;
        width: 120px;
    }
    .style2 {
        color: Blue;
        font-weight: bold;
        text-decoration: underline;
        height: 25px;
    }
    .style5 {
        color: Blue;
        font-weight: bold;
        text-decoration: underline;
    }
    .style6 {
        width: 96px;
    }
    .style7 {
        width: 150px;
    }
</style>

</asp:Content>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>

    <div id='calendar'>
    </div>

VB.NET:

     Public Class _Default
    Inherits System.Web.UI.Page
    Public eventstring As String
"server=xxx.xxx.x.x\SQLEXPRESS;database=attendance;uid=ab;pwd=abcde;"
    Dim Conn As SqlConnection
    Dim da As SqlDataAdapter
    Dim cmd As SqlCommand
    Dim rdmysql As SqlDataReader
    Dim strsql As String
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Dim lbl As Label = Master.FindControl("lblHeader")
    lbl.Text = "IT Attendance"


    Dim startdate As String = Format(Now, "yyyy-MM-dd")
    If txtStartDate.Value = "" Then txtStartDate.Value = startdate
    If txtEndDate.Value = "" Then txtEndDate.Value = startdate
    If txtStartEvent.Value = "" Then txtStartEvent.Value = startdate
    If txtEndEvent.Value = "" Then txtEndEvent.Value = startdate

    Conn = New SqlConnection
    Conn.ConnectionString = ConnStr
    Conn.Open()

    eventstring = ""

    strsql = "SELECT * FROM record;"
    cmd = New SqlCommand
    cmd.Connection = Conn
    cmd.CommandText = strsql
    rdmysql = cmd.ExecuteReader
    Do While rdmysql.Read = True
        eventstring = eventstring & "{title: '" & rdmysql.GetString(1) & " - " & rdmysql.GetString(3) & "', start: '" & rdmysql.GetString(2) & "',  color: 'yellow', borderColor: 'black', textColor: 'black'},"

    Loop
    cmd.Dispose()
    rdmysql.Close()

    strsql = "SELECT * FROM event;"
    cmd = New SqlCommand
    cmd.Connection = Conn
    cmd.CommandText = strsql
    rdmysql = cmd.ExecuteReader
    Do While rdmysql.Read = True
        eventstring = eventstring & "{title: '" & rdmysql.GetString(1) & "', start: '" & rdmysql.GetString(2) & "', color: 'skyblue', textColor: 'black', borderColor: 'black'},"

    Loop
    cmd.Dispose()
    rdmysql.Close()
    eventstring = Mid(eventstring, 1, Len(eventstring) - 1)

任何人都可以帮我解决这个问题吗?

0 个答案:

没有答案