用户控制只能在开发环境中使用,而不能在UAT或生产环境中使用

时间:2018-07-16 14:11:41

标签: c# asp.net user-controls

下面的用户控件在本地主机和开发环境中都可以很好地工作,但是在UAT或生产环境中不起作用。

用户控制代码如下:

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="appSearchPane.ascx.cs" 
Inherits="ApplicationModule_appSearchPane" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<script type="text/javascript">
function ShowValidationErrorMessage(errorMsg)
{
alert(errorMsg);
return false;
}

</script>

<table class="appsearchpane"  >
    <tr style="vertical-align:middle;">
        <td class="searchpanellabel" >
            From Date
        </td>                          
        <td class="labeltextstyle">
            :
            <asp:TextBox ID="txtFromDate" Width="75px" runat="server"></asp:TextBox>
            <asp:Image ID="Image2" runat="server" ImageAlign="Middle" ImageUrl="~/Images/calendar.JPG" />&nbsp;<br />                                  
            <ajaxToolkit:CalendarExtender ID="_cc1" runat="server" PopupButtonID="Image2"
             TargetControlID="txtFromDate" Format="dd-MMM-yyyy" PopupPosition="Right">                                    
            </ajaxToolkit:CalendarExtender> 
        </td>
        <td class="searchpanellabel">
            To Date
        </td>                          
        <td class="labeltextstyle">
            :
            <asp:TextBox ID="txtToDate" Width="75px" runat="server"></asp:TextBox>
            <asp:Image ID="Image1" runat="server" ImageAlign="Middle" ImageUrl="~/Images/calendar.JPG" />&nbsp;<br />                                  
            <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" PopupButtonID="Image1"
             TargetControlID="txtToDate" Format="dd-MMM-yyyy" PopupPosition="left">                                    
            </ajaxToolkit:CalendarExtender>                                     
        </td>         
        <td class="searchpanellabel">Bill No.</td>
        <td>
         <asp:TextBox ID="txtBillNo" Width="60px" runat="server"></asp:TextBox> 
        </td>
        <td class="searchpanellabel">Status</td>
        <td>                            
            <asp:DropDownList ID="ddlStatus" Width="170px" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlStatus_OnSelectedIndexChanged">  

            </asp:DropDownList>    
        </td>

        <td style="width:65px;text-align:right;" valign="middle" >
            <asp:Button ID="GoBtn" runat="server" TabIndex="0" 
                CssClass="searchpanebutton"  OnClick="GoBtn_Click"/>

        </td>



    </tr>
    <tr>
     <td class="searchpanellabel">Name of Guest</td>
        <td>
         <asp:TextBox ID="txtGuestName" Width="100px" runat="server"></asp:TextBox> 
        </td>
        <td class="searchpanellabel">Organisation</td>
        <td>
         <asp:TextBox ID="txtOrganisation" Width="100px" runat="server"></asp:TextBox> 
        </td>
        <td class="searchpanellabel">Creator</td>
        <td>
         <asp:TextBox ID="txtCreator" Width="100px" runat="server"></asp:TextBox> 
        </td>
    </tr>

    <tr>
        <td colspan="9">
            <asp:Label ID="lblErrorMessage" runat="server" Text="" ForeColor="Red" Font-Bold="true" Font-Size="Small"></asp:Label>
        </td>
    </tr>
</table>

下面的ASPX页面(其中包含用户控件):

<asp:UpdatePanel ID="UpdtPnlBillingAdvices" runat="server" >
                    <ContentTemplate>
                        <asp:Panel ID="pnlBillingAdvice" runat="server" Visible="true">
                <div style="text-align: left; width: 100%; overflow: auto;">
                    <!--- Enter Billing Advice Start -->
                    <uc3:appSearchPane ID="_appSearchPane" runat="server" OnddlStatusOnSelectedIndexChanged="OnddlStatusOnSelectedIndexChanged" OnappSearchPaneClick="AppSearchPane_OnAppSearchPaneClick" />
                    <!--- Enter Billing Advice End -->
                </div>

用户控件后面的代码如下:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadStatus();
        }
    }
protected void GoBtn_Click(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsValid) return;
            if (appSearchPaneClick != null) appSearchPaneClick(this, EventArgs.Empty);
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }

在浏览器的控制台中出现的错误如下:

  

消息:Sys.WebForms.PageRequestManagerParserErrorException:无法解析从服务器收到的消息。导致此错误的常见原因是通过调用Response.Write(),响应过滤器,HttpModules或服务器跟踪来修改响应。详细信息:“

附近的错误解析

如果问题需要更多详细信息以确定错误原因,请告诉我。

任何指针都可以解决该问题。

谢谢。

0 个答案:

没有答案