0

在我的 asp.net 应用程序中(VB 是服务器端背景) - 我有一个不会运行 onload 或回发服务器端事件的页面。在本地开发构建中,它运行正确,但是当在亚马逊 EC2 实例上发布时,onload 似乎没有执行,即使回发正在发生(使用 onload javascript 警报测试以确保回发正在发生) -当名为 drpdn_status 的下拉列表更改时,处理此问题的服务器端函数似乎没有执行。谁能明白为什么会发生这种情况?下面列出的是页面代码,后面是服务端 on load 和 selectedIndexChanged 函数来处理下拉列表的变化

页面代码

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="toDoListModifyEntity_PT.aspx.vb" inherits="iPlan.toDoListModifyEntity_PT" %>
<%@ Register TagPrefix="Component" Namespace="components" Assembly="components" %>
<%@ Register TagPrefix="UserControl" TagName="ConditionalDetails" Src="../include/ConditionalDetailsPanel.ascx" %>
<%@ Register TagPrefix="UserControl" TagName="Deliverable" Src="../include/AttachmentToEntity.ascx" %>
<%@ Register TagPrefix="UserControl" TagName="EntityPredecessorsTable" Src="../include/EntityPredListPanel.ascx" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<HEAD>
        <title><%=Application("BrowserTitle")%></title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    <LINK href="../solutions/DetailScreenTest.css" type="text/css" rel="stylesheet">
    <LINK href="../StyleSheet.css" type="text/css" rel="stylesheet">
    <!-- includes for: calendar popUp -->
    <script language="JavaScript" src="../include/calendar.vRef.NET.js"></script>
    <script language="JavaScript" src="../include/ShowHelp.js"></script>
    <LINK href="../include/calendar.blueIce.css" type="text/css" rel="stylesheet">
    <LINK rel="stylesheet" type="text/css" href="../Styles.css">
</HEAD>
<body>
    <form id="Form2" method="post" runat="server">
        <table cellSpacing="0" cellPadding="0" width="100%" border="0">
            <tr>
                <td class="pageHeader">Update this Task</td>
            </tr>
        </table>
        <div class="hideforprint" style="HEIGHT: 30px">
            <table cellSpacing="0" cellPadding="0" width="100%" border="0">
                <tr>
                    <td></td>
                    <td align="right"><IMG style="CURSOR: hand" onclick="showHelp('../', 'pendingtasks.htm')" alt="Help on Detail Screen"
                            src="../images/helpdashboard.gif"></td>
                    <!--
                <td align="right" width="1%"><img onclick="window.parent.execScript('ToggleDetailDivSize()'); if (this.action == 'max') {this.action='restore'; this.src = '../images/bigRestore.gif'; this.alt='Restore Detail Screen';} else {this.action='max'; this.src = '../images/bigMax.gif'; this.alt='Maximize Detail Screen';}" 
                        action="max" 
                        alt="Maximize Detail Screen"
                        src="../images/bigMax.gif"
                        style="cursor: hand" ></td>
                -->
                    <td align="right" width="1%"><IMG style="CURSOR: hand" onclick="window.parent.execScript('ToggleDetailDiv()')" alt="Close Detail Screen"
                            src="../images/BigX.gif"></td>
                </tr>
            </table>
        </div>
        <!-- START nav buttons-->
        <div class="hideforprint">
            <table cellSpacing="0" cellPadding="0" width="100%" border="0">
                <tr>
                    <td class="pageHeader">
                        <table id="navControl_tlbNav" border="0">
                            <tr>
                                <!--
                        <td class="infotext2" valign="Top" style="width:50px;"><img onmouseover="imgOv(this, '../images/task.gif')" onmouseout="imgOu(this, '../images/task_over.gif')" onclick="imgclick('../tasks/modifytask.aspx', '&amp;mode=create', 13)" src="../images/task_over.gif" border="0" style="cursor:hand;" /><br> Create Task</td>
                        <td class="infotext2" valign="Top" style="width:50px;"><img onmouseover="imgOv(this, '../images/Milestone.gif')" onmouseout="imgOu(this, '../images/Milestone.gif')" onclick="imgclick('../tasks/MilestoneLinking.aspx', '&amp;mode=create&amp;milestone=true', 13)" src="../images/Milestone.gif" border="0" style="cursor:hand;" /><br>Create Milestone</td>
                        <td class="infotext2" valign="Top" style="width:50px;"><img onmouseover="imgOv(this, '../images/modify.gif')" onmouseout="imgOu(this, '../images/modify_over.gif')" onclick="imgclick('../tasks/modifytask.aspx', '&amp;mode=edit', 13)" src="../images/modify_over.gif" border="0" style="cursor:hand;" /><br>Modify Task</td>
                        <td class="infotext2" valign="Top" style="width:50px;"><img onmouseover="imgOv(this, '../images/delete.gif')" onmouseout="imgOu(this, '../images/delete_over.gif')" onclick="imgclick('../tasks/deletetask.aspx', '', 13)" src="../images/delete_over.gif" border="0" style="cursor:hand;" /><br>Delete Task</td>
                        -->
                                <td class="infotext2" style="WIDTH: 50px" vAlign="top"><IMG onmouseover="imgOv(this, '../images/attachfile.gif')" style="CURSOR: hand" onclick="imgclick('../listing/attachments.aspx', '', 13)"
                                        onmouseout="imgOu(this, '../images/attachfile_over.gif')" src="../images/attachfile_over.gif" border="0"><br>
                                    Attach Files</td>
                                <td class="infotext2" style="WIDTH: 50px" vAlign="top"><IMG onmouseover="imgOv(this, '../images/DetailsScreenNotes_over.gif')" style="CURSOR: hand"
                                        onclick="imgclick('../notesforum/EntityNotes.aspx', '', 13)" onmouseout="imgOu(this, '../images/DetailsScreenNotes.gif')" src="../images/DetailsScreenNotes.gif"
                                        border="0"><br>
                                    Notes</td>
                                <td class="infotext2" style="WIDTH: 50px" vAlign="top"><IMG onmouseover="imgOv(this, '../images/PrintDetailsPage_over.gif')" style="CURSOR: hand"
                                        onclick="imgclick('print', '', 13)" onmouseout="imgOu(this, '../images/PrintDetailsPage.gif')" src="../images/PrintDetailsPage.gif"
                                        border="0"><br>
                                    Print Details</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
        <!-- END nav buttons-->
        <!-- START NOTICES task predecessor list -->
        <asp:Panel ID="pnl_msg_predecessorsInSameAction" Runat="server" Visible="False">
            <TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
                <TR class="detailHeader" height="1">
                    <TD height="1" width="10">&nbsp;</TD>
                    <TD height="1" width="200">Notice</TD>
                    <TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
                </TR>
            </TABLE>
            <TABLE class="detailTable" cellSpacing="0" cellPadding="4" width="100%">
                <TR class="detailRow">
                    <TD class="detailLabel"><IMG src="../images/yellow-exclamation-sign.gif"></TD>
                    <TD class="detailLabel">This task is <SPAN class="DetailsOtherGreyed">grayed-out</SPAN>
                        pending the completion of the following predecessor Tasks. If this Task is 
                        updated, future status updates will be restricted until the Project Manager 
                        takes action.</TD>
                </TR>
            </TABLE>
        </asp:Panel>
        <asp:Panel ID="pnl_msg_predecessorsActionLinked" Runat="server" Visible="False">
            <TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
                <TR class="detailHeader" height="1">
                    <TD height="1" width="10">&nbsp;</TD>
                    <TD height="1" width="200">Notice</TD>
                    <TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
                </TR>
            </TABLE>
            <TABLE class="detailTable" cellSpacing="0" cellPadding="4" width="100%">
                <TR class="detailRow">
                    <TD class="detailLabel"><IMG src="../images/yellow-exclamation-sign.gif"></TD>
                    <TD class="detailLabel">This task is <SPAN class="DetailsOtherGreyed">grayed-out</SPAN>
                        pending the completion of the following predecessor Actions. If this Task is 
                        updated, future status updates will be restricted until the Administrator takes 
                        action.</TD>
                </TR>
            </TABLE>
        </asp:Panel>
        <!-- END NOTICES task predecessor list -->
        <!-- START NOTICES Status Marked Early -->
        <asp:Panel ID="pnl_msg_earlyProgressAlreadyMarked_notifiedPM" Runat="server" Visible="False">
            <TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
                <TR class="detailHeader" height="1">
                    <TD height="1" width="10">&nbsp;</TD>
                    <TD height="1" width="200">Notice</TD>
                    <TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
                </TR>
            </TABLE>
            <TABLE class="detailTable" cellSpacing="0" cellPadding="4" width="100%">
                <TR class="detailRow">
                    <TD class="detailLabel"><IMG src="../images/yellow-exclamation-sign.gif"></TD>
                    <TD class="detailLabel">Status for this Task has been marked and the Project 
                        Manager notified. Future status updates await Project Manager action. Please 
                        contact the PM for further information.</TD>
                </TR>
            </TABLE>
        </asp:Panel>
        <asp:Panel ID="pnl_msg_earlyProgressAlreadyMarked_notifiedAdmin" Runat="server" Visible="False">
            <TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
                <TR class="detailHeader" height="1">
                    <TD height="1" width="10">&nbsp;</TD>
                    <TD height="1" width="200">Notice</TD>
                    <TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
                </TR>
            </TABLE>
            <TABLE class="detailTable" cellSpacing="0" cellPadding="4" width="100%">
                <TR class="detailRow">
                    <TD class="detailLabel"><IMG src="../images/yellow-exclamation-sign.gif"></TD>
                    <TD class="detailLabel">Status for this Task has been marked and an Administrator 
                        notified. Future status updates await Administrator action. Please contact the 
                        Administrator for further information.</TD>
                </TR>
            </TABLE>
        </asp:Panel>
        <!-- END NOTICES Status Marked Early -->
        <!-- START task predecessor list -->
        <asp:panel id="pnl_predecessorList" Runat="server" visible="false">
            <TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
                <TR class="detailHeader" height="1">
                    <TD height="1" width="10">&nbsp;</TD>
                    <TD height="1" width="200">Predecessors</TD>
                    <TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
                </TR>
            </TABLE> <!-- <TABLE class="detailTable" id="Table3" cellSpacing="0" cellPadding="4" width="100%"> -->
            <UserControl:EntityPredecessorsTable style="BORDER-BOTTOM: red thin solid; BORDER-LEFT: red thin solid; BACKGROUND-COLOR: red; BORDER-TOP: red thin solid; BORDER-RIGHT: red thin solid; cGKattrib: hello chris"
                id="usrCntrl_EntityPredecessor" class="detailTable" runat="server" relativePathToImages="../images/" relativePathToRoot="../"
                width="100%" displayMode="PredecessorMode"></UserControl:EntityPredecessorsTable>
        </asp:panel>
        <asp:Label ID="lbl_cGKDebug" Runat="server" Visible="False" />
        <script language="VB" runat="server">
    Private Sub usrCntrl_EntityPredecessor_EntityHasActionLink() Handles usrCntrl_EntityPredecessor.EntityHasPredecessorsActionLinked

        '"../ViewTask.aspx" & Request.QueryString.ToString
        lbl_cGKDebug.text += "TESTING JIZZ: ../tasks/ViewTask.aspx?" & Request.QueryString.ToString &" <br />"
        'Response.redirect("../tasks/ViewTask.aspx?" & Request.QueryString.ToString )


        pnl_predecessorList.Visible = True

        'Show user messages (only if global flags for both other early-status-marked notices are not on):
        if gbl_bool_earlyStatusAlreadyMarked_notifyAdmin = false and gbl_bool_earlyStatusAlreadyMarked_notifyPM = false then
            pnl_msg_predecessorsInSameAction.Visible = False
            pnl_msg_predecessorsActionLinked.Visible = True
        end if

        'Hide Modify Panel, Addt'nl Details
        pnl_dynDetails.visible = false
        pnl_modifyElements.visible = false

        btn_save.Text = "Inform Administrator"
        btn_save.visible = false
        lbl_btn_save_message.visible = true
        lbl_btn_save_message.Text = "You may not save status on this task."

        'Change the way the save function behaves:
        gbl_bool_predecessorsInOtherActionExist_notifyAdmin = True

    End Sub

    Private Sub usrCntrl_EntityPredecessor_EntityHasPredecessorsInSameAction() Handles usrCntrl_EntityPredecessor.EntityHasPredecessorsInSameAction
        lbl_debugInfo.Text += "<br />usrCntrl_EntityPredecessor_EntityHasNoPredecessors Sub: there's been an EVENT THIS IS GREAT<br />"

        pnl_predecessorList.Visible = True 'False

        'Show user messages (only if global flags for both other early-status-marked notices are not on):
        if gbl_bool_earlyStatusAlreadyMarked_notifyAdmin = false and gbl_bool_earlyStatusAlreadyMarked_notifyPM = false then
            pnl_msg_predecessorsInSameAction.Visible = True
            pnl_msg_predecessorsActionLinked.Visible = False
        end if

        btn_save.Text = "Inform PM" '"Save"

        'Change the way the save function behaves:
        gbl_bool_predecessorsInSameActionExist_notifyPM = True 'False

    End Sub
        </script>
        <!-- END task predecessor list -->
        <table height="1" cellSpacing="0" cellPadding="0" border="0">
            <tr class="detailHeader" height="1">
                <td width="10" height="1">&nbsp;</td>
                <td width="200" height="1">Dates</td>
                <td height="1"><IMG height="15" src="../images/whiteslant.gif"></td>
            </tr>
        </table>
        <TABLE class="detailTable" id="Table3" cellSpacing="0" cellPadding="4" width="100%">
            <TR class="detailRow">
                <TD class="detailLabel" vAlign="top">Color</TD>
                <TD vAlign="top">:</TD>
                <TD vAlign="top" colSpan="4"><asp:label id="lblColor" Runat="server"></asp:label></TD>
            </TR>
            <TR class="detailRowalt">
                <TD class="detailLabel">Work [Hours(s)]</TD>
                <TD>:</TD>
                <TD><asp:label id="lblHours" Runat="server"></asp:label></TD>
                <TD class="detailLabel">Duration [Day(s)]</TD>
                <TD>:</TD>
                <TD><asp:label id="lblDays" Runat="server"></asp:label></TD>
            </TR>
            <TR class="detailRow">
                <TD class="detailLabel" width="20%">Sched Start</TD>
                <TD width="1%">:</TD>
                <TD width="29%"><asp:label id="lblSchedStart" Runat="server"></asp:label></TD>
                <TD class="detailLabel" width="20%">Sched End</TD>
                <TD width="1%">:</TD>
                <TD width="29%"><asp:label id="lblSchedEnd" Runat="server"></asp:label></TD>
            </TR>
            <TR class="detailRowalt">
                <TD class="detailLabel">Actual Start</TD>
                <TD>:</TD>
                <TD><asp:label id="lblActualStart" Runat="server"></asp:label></TD>
                <TD class="detailLabel">Actual End</TD>
                <TD>:</TD>
                <TD><asp:label id="lblActualEnd" Runat="server"></asp:label></TD>
            </TR>
            <TR class="detailRow">
                <TD class="detailLabel">Projected Start</TD>
                <TD>:</TD>
                <TD><asp:label id="lblProjectedStart" Runat="server"></asp:label></TD>
                <TD class="detailLabel">Projected End</TD>
                <TD>:</TD>
                <TD><asp:label id="lblProjectedEnd" Runat="server"></asp:label></TD>
            </TR>
        </TABLE>
        <!-- == -->
        <asp:panel id="pnl_dynDetails" Runat="server" Visible="False">
            <TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
                <TR class="detailHeader" height="1">
                    <TD height="1" width="10">&nbsp;</TD>
                    <TD height="1" width="200">* Additional Details</TD>
                    <TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
                </TR>
            </TABLE>
            <asp:Table id="tbl_dynDetails" Runat="server" Width="100%" CellSpacing="0" CellPadding="4"
                CssClass="detailTable"></asp:Table>
        </asp:panel>
        <!-- START PANEL pnl_modifyElements -->
        <asp:panel id="pnl_modifyElements" Runat="server">
            <asp:label id="lbl_debugInfo" Runat="server" visible="false"></asp:label>
            <TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
                <TR class="detailHeader" height="1">
                    <TD height="1" width="10">&nbsp;</TD>
                    <TD height="1" width="200">* Please fill in all the fields</TD>
                    <TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
                </TR>
            </TABLE>
            <TABLE id="Table5" class="detailTable" cellSpacing="0" cellPadding="4" width="100%">
                <TR class="detailRow">
                    <TD style="HEIGHT: 24px" class="detailLabel" width="20%">Status</TD>
                    <TD style="HEIGHT: 24px" width="1%">:</TD>
                    <TD width="1%">
                        <DIV style="DISPLAY: none" id="divdrpdn_status"><FONT color="red">*</FONT></DIV>
                    </TD>
                    <TD style="HEIGHT: 24px" width="29%" colSpan="4">
                        <asp:dropdownlist id="drpdn_status" Runat="server" AutoPostBack="True"></asp:dropdownlist></TD>
                </TR>
                <TR id="tblRow_actualStartDate" class="detailRowalt" runat="server">
                    <TD class="detailLabel">Actual Start Date</TD>
                    <TD>:</TD>
                    <TD>
                        <DIV style="DISPLAY: none" id="divdatfld_actualStartDate"><FONT color="red">*</FONT></DIV>
                    </TD>
                    <TD>
                        <Component:DateField id="datfld_actualStartDate" Runat="server" DisallowFutureDates="true" Enabled="true"
                            size="10"></Component:DateField></TD>
                </TR>
                <TR id="tblRow_actualEndDate" class="detailRow" runat="server">
                    <TD class="detailLabel">Actual End Date</TD>
                    <TD>:</TD>
                    <TD>
                        <DIV style="DISPLAY: none" id="divdatfld_actualEndDate"><FONT color="red">*</FONT></DIV>
                    </TD>
                    <TD>
                        <Component:DateField id="datfld_actualEndDate" Runat="server" DisallowFutureDates="true" Enabled="true"
                            size="10"></Component:DateField></TD>
                </TR>
                <TR id="tblRow_estimatedEndDate" class="detailRowalt" runat="server">
                    <TD class="detailLabel">Estimated End</TD>
                    <TD>:</TD>
                    <TD>
                        <DIV style="DISPLAY: none" id="divdatfld_estimatedEndDate"><FONT color="red">*</FONT></DIV>
                    </TD>
                    <TD colSpan="4">
                        <Component:DateField id="datfld_estimatedEndDate" Runat="server" DisallowFutureDates="false" Enabled="true"
                            size="10"></Component:DateField></TD>
                </TR>
                <TR id="tblRow_remarks" class="detailRow" runat="server">
                    <TD style="HEIGHT: 24px" class="detailLabel" width="20%">
                        <asp:Label id="lbl_remarks" Runat="server"></asp:Label></TD>
                    <TD style="HEIGHT: 24px" width="1%">:</TD>
                    <TD width="1%">
                        <DIV style="DISPLAY: none" id="divtxtbx_remarks"><FONT color="red">*</FONT></DIV>
                    </TD>
                    <TD style="HEIGHT: 24px" width="29%" colSpan="4">
                        <asp:textbox id="txtbx_remarks" Runat="server" Rows="3" TextMode="MultiLine"></asp:textbox></TD>
                </TR> <!--
            <tr class="detailRow">
                <td class="detailLabel" style="CURSOR: hand; COLOR: green; TEXT-DECORATION: underline"
                    onclick="callZoom(33,<%=session("user_id")%>, '<%=session("user_name")%>');" colSpan="6">Analyze your progress</td>
            </tr>
            --></TABLE> <!-- START Deliverable User control -->
            <asp:panel id="pnl_deliverable" Runat="server" visible="true">
                <TABLE border="0" cellSpacing="0" cellPadding="0" width="98%" align="center">
                    <TR>
                        <TD>
                            <TABLE cellSpacing="0" cellPadding="2" width="100%">
                                <TR>
                                    <TD><FONT style="FONT-FAMILY: Tahoma, Verdana; COLOR: darkblue; FONT-SIZE: 12pt; FONT-WEIGHT: bold">A 
                                            Deliverable is Required </FONT>
                                    </TD>
                                </TR>
                            </TABLE>
                        </TD>
                    </TR>
                    <TR>
                        <TD style="BORDER-BOTTOM: darkgray 1px solid; BORDER-LEFT: darkgray 1px solid; WIDTH: 100%; BORDER-TOP: darkgray 1px solid; BORDER-RIGHT: darkgray 1px solid"
                            bgColor="aliceblue"></TD>
                    </TR>
                </TABLE>
                <UserControl:Deliverable id="usrCntrl_AttachDeliverable" runat="server"></UserControl:Deliverable>
            </asp:panel> 
            <asp:panel id="pnl_condDetailsEdit" Visible="true" Runat="server">
                <TABLE cellSpacing="0" cellPadding="0" height="1">
                    <TR class="detailHeader" height="1">
                        <TD height="1" width="10">&nbsp;</TD>
                        <TD height="1" width="200"><SPAN>*</SPAN> Conditional Details</TD>
                        <TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
                    </TR>
                </TABLE>
                <UserControl:ConditionalDetails id="usrCntrl_ConditionalDetailsPanel" runat="server"></UserControl:ConditionalDetails>
            </asp:panel> <!-- END Conditional Details User control -->
            <asp:button id="btn_save" Runat="server" Text="Save"></asp:button>
            <asp:label id="lbl_btn_save_message" Runat="server" visible="False"></asp:label>
        </asp:panel>
        <asp:panel id="pnl_modifyPerformedMessage" Runat="server">
            <asp:Label id="lbl_modifyPerformedMessage" Runat="server"></asp:Label>
        </asp:panel>
        <input id="hdn_resourceId" type="hidden" name="hdn_resourceId"> <input id="hdnexplode" type="hidden" name="hdnexplode">
        <input type="hidden" id="RefreshParent" name="RefreshParent"> <input type="hidden" id="hdnSessionTimeout" name="hdnSessionTimeout" runat="server">
    </form>
    </body>
</html>

在服务器端的负载和其余部分:

Imports System.Data.SqlClient
Imports components
Partial Class toDoListModifyEntity_PT
Inherits BasePage
#Region " Web Form Designer Generated Code "
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents NavSpot As System.Web.UI.WebControls.PlaceHolder
Dim arlist_dynCompnts As ArrayList
Dim gbl_task_Type As Integer = -1
Dim gbl_str_deliverableStatus As String
Public gbl_bool_predecessorsInSameActionExist_notifyPM As Boolean = False
Public gbl_bool_predecessorsInOtherActionExist_notifyAdmin As Boolean = False     
Public gbl_bool_earlyStatusAlreadyMarked_notifyPM As Boolean
Public gbl_bool_earlyStatusAlreadyMarked_notifyAdmin As Boolean

Protected WithEvents usrCntrl_EntityPredecessor As EntityPredListPanel

Protected WithEvents usrCntrl_ConditionalDetailsPanel As ConditionalDetailsPanel
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
    InitializeComponent()

End Sub

#End Region
 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


    Dim DS As SqlDataReader = getEntityDetails(CType(Page.Request.QueryString("taskgrpid"), Integer), CType(Page.Request.QueryString("taskgrpcategory"), Integer))
    DS.Read()

    If Not IsDBNull(DS.Item("Type")) Then gbl_task_Type = CType(DS.Item("Type"), Integer)

    If Not Page.IsPostBack Then
        fillStatuDropDown(CType(Page.Request.QueryString("taskgrpid"), Integer), 13, CType(Session.Item("user_id"), Integer))

        drpdn_status_SelectedIndexChanged(New Object, New System.EventArgs)


        If Page.Request.QueryString("taskgrpcategory") = "13" Then

            datfld_actualStartDate.Text = DS.Item("Actual Start").ToString()
            datfld_actualEndDate.Text = DS.Item("Actual End").ToString()
            datfld_estimatedEndDate.Text = DS.Item("ProjEnd").ToString()
            txtbx_remarks.Text = DS.Item("remark").ToString()

            lblSchedStart.Text = DS.Item("Scheduled Start").ToString()
            lblSchedEnd.Text = DS.Item("Scheduled End").ToString()
            lblActualStart.Text = DS.Item("Actual Start").ToString()
            lblActualEnd.Text = DS.Item("Actual End").ToString()
            lblProjectedStart.Text = DS.Item("ProjStart").ToString()
            lblProjectedEnd.Text = DS.Item("ProjEnd").ToString()
            lblHours.Text = DS.Item("Hours").ToString()
            lblDays.Text = DS.Item("Duration").ToString()

            If IsDBNull(DS.Item("color")) = False Then
                If DS.Item("color") = "G" Then
                    lblColor.Text = "<img src=""../images/G.gif""> Green"
                ElseIf DS.Item("color") = "Y" Then
                    lblColor.Text = "<img src=""../images/Y.gif""> Yellow"
                ElseIf DS.Item("color") = "O" Then
                    lblColor.Text = "<img src=""../images/O.gif""> Orange"
                ElseIf DS.Item("color") = "R" Then
                    lblColor.Text = "<img src=""../images/R.gif""> Red"
                Else
                    lblColor.Text = "None"
                End If
            Else
                lblColor.Text = "None"
            End If

            If lblActualStart.Text <> "" Then
                lblProjectedStart.Visible = False
            Else
                lblProjectedStart.Visible = True
            End If

        End If


    End If

    DS.Close()


    If Page.Request.QueryString("taskgrpcategory") = "13" Then

        pnl_dynDetails.Visible = False
        If gbl_task_Type <> -1 Then
            pnl_dynDetails.Visible = True
            arlist_dynCompnts = New ArrayList
            CustomFieldsLibrary.editDynamicFields(tbl_dynDetails, CType(Page.Request.QueryString("taskgrpid"), Integer), 13, gbl_task_Type, arlist_dynCompnts, (New SqlConnection((New ConnInfo).GetConnString)), True)
            'CustomControls.CustomFieldsLibrary.showDynamicDetails(tbl_dynDetails, CType(Page.Request.QueryString("taskgrpid"), Integer), 13, task_Type, Nothing, (New SqlConnection((New ConnInfo).GetConnString)), True)
        End If

    End If


    gbl_str_deliverableStatus = ExecutionFunctions.checkEntityDeliverableStatus(CType(Page.Request.QueryString("taskgrpid"), String))
    lbl_debugInfo.Text += System.DateTime.Now.ToLongTimeString() + " gbl_str_deliverableStatus: '" + gbl_str_deliverableStatus + "'<br />"



    gbl_bool_earlyStatusAlreadyMarked_notifyPM = ExecutionFunctions.checkEarlyProgressAlreadyMarked_PM(CType(Page.Request.QueryString("taskgrpid"), String))


    gbl_bool_earlyStatusAlreadyMarked_notifyAdmin = False 

    If gbl_bool_earlyStatusAlreadyMarked_notifyPM Then
        pnl_msg_predecessorsInSameAction.Visible = False
        pnl_msg_predecessorsActionLinked.Visible = False

        pnl_msg_earlyProgressAlreadyMarked_notifiedPM.Visible = True
    Else
        pnl_msg_earlyProgressAlreadyMarked_notifiedPM.Visible = False
    End If

    If gbl_bool_earlyStatusAlreadyMarked_notifyAdmin Then
        pnl_msg_predecessorsInSameAction.Visible = False
        pnl_msg_predecessorsActionLinked.Visible = False
        pnl_msg_earlyProgressAlreadyMarked_notifiedPM.Visible = False

        pnl_msg_earlyProgressAlreadyMarked_notifiedAdmin.Visible = True
    Else
        pnl_msg_earlyProgressAlreadyMarked_notifiedAdmin.Visible = False
    End If

    If gbl_bool_earlyStatusAlreadyMarked_notifyAdmin Or gbl_bool_earlyStatusAlreadyMarked_notifyPM Then
        pnl_modifyElements.Visible = False
    Else
        pnl_modifyElements.Visible = True
    End If

    btn_save.Attributes("onClick") = "return validate(this.form);"

    lbl_debugInfo.Text += "Page_Load END<br />"

End Sub

drpdn_status_SelectedIndexChanged:

Private Sub drpdn_status_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles drpdn_status.SelectedIndexChanged

    lbl_remarks.Text = drpdn_status.SelectedItem.Text + " Remarks"

    Select Case drpdn_status.SelectedValue 
        Case 7 
            tblRow_actualStartDate.Visible = True
            tblRow_actualEndDate.Visible = False
            tblRow_estimatedEndDate.Visible = False
            tblRow_remarks.Visible = False

            pnl_deliverable.Visible = False

        Case 8 
            tblRow_actualStartDate.Visible = True
            tblRow_actualEndDate.Visible = False
            tblRow_estimatedEndDate.Visible = True
            tblRow_remarks.Visible = True

            pnl_deliverable.Visible = False

        Case 15 
            tblRow_actualStartDate.Visible = True
            tblRow_actualEndDate.Visible = False
            tblRow_estimatedEndDate.Visible = True
            tblRow_remarks.Visible = False

            pnl_deliverable.Visible = False

        Case 9 
            tblRow_actualStartDate.Visible = True
            tblRow_actualEndDate.Visible = True
            tblRow_estimatedEndDate.Visible = False
            tblRow_remarks.Visible = True

            Dim str_deliverableStatus As String = ExecutionFunctions.checkEntityDeliverableStatus(CType(Page.Request.QueryString("taskgrpid"), String))

            If str_deliverableStatus = "1" Then pnl_deliverable.Visible = True

            lbl_debugInfo.Text += "Local str_deliverableStatus: '" + str_deliverableStatus + "'<br />"
        Case Else
            Throw New Exception("ERROR: unrecognized status *Value* (" + drpdn_status.SelectedItem.Value.ToString + ")")

    End Select


End Sub

谢谢你的帮助。

更新:如果我只用一个客户端脚本替换 onload 来弹出一个警报,让我们知道页面加载正在运行,它在开发端工作,但在服务器端仍然没有任何反应。即使我们调用一个函数 (fillStatuDropDown) 来填充加载下拉列表 - 即使我们已经删除了对填充下拉列表的函数的所有调用,部署端的下拉列表也会加载两个值,但在开发端它不会将任何值填充到下拉列表中

4

2 回答 2

0

您的页面 AutoEventWireup 为 false,事件附加在哪里?

此外,您的 Page_Load 中存在某种逻辑问题。

If Not Page.IsPostBack Then
    fillStatuDropDown(CType(Page.Request.QueryString("taskgrpid"), Integer), 13,    CType(Session.Item("user_id"), Integer))

    drpdn_status_SelectedIndexChanged(New Object, New System.EventArgs)

让我们以第一次加载页面的情况为例,然后正确附加了 SelectedIndexChanged 事件,但是如果您更改索引,则会发生另一个回发,因此不会附加 selectedIndexChanged 事件,从而导致事件不会被触发。

于 2013-05-13T14:23:31.857 回答
0

问题是由于 FTP 部署造成的损坏。能够重新上传整个应用程序,然后一切都按预期工作。

于 2013-05-15T15:35:36.650 回答