0

When I use the ScriptManager and UpdatePanel (asp.net 4.0) When I deployed the code to the server, I opened F12 of the browser and found the following error: "Sys is not defined"

This error is in the js code generated by ScriptManager

<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ScriptManager', 'Form1', ['tUpdatePanel',''], ['btnHistorySearch',''], [], 90, '');
//]]>
</script>

The code of my aspx is as follows:

<div class="userContainer">
                <asp:ScriptManager ID="ScriptManager" runat="server" />
                <asp:UpdatePanel ID="UpdatePanel" UpdateMode="Conditional" runat="server">
                    <ContentTemplate>
                        <asp:GridView ID="gvHistory" runat="server" EnableViewState="false" AutoGenerateColumns="false"
                            RowStyle-Height="20" BorderColor="#e6e6e6" CssClass="gvTable" Width="100%">
                            <Columns>
                                <asp:BoundField HeaderText="Field Name" DataField="FieldName" HeaderStyle-CssClass="gvTopLeft" />
                                <asp:BoundField HeaderText="Old Value" DataField="OldValue" HeaderStyle-CssClass="gvTopLeft" />
                                <asp:BoundField HeaderText="New Value" DataField="NewValue" HeaderStyle-CssClass="gvTopLeft" />
                                <asp:BoundField HeaderText="Recorded By" DataField="CreatedByName" HeaderStyle-CssClass="gvTopLeft" />
                                <asp:BoundField HeaderText="Recorded On" DataField="CreatedOn" HeaderStyle-CssClass="gvTopLeft" DataFormatString="{0:MM/dd/yyyy HH:mm:ss}" />
                            </Columns>
                        </asp:GridView>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>

The strange thing is that everything work fine when I debug locally, and so does my colleague, but when deploying to the server, my colleague logs in and sees a normal page, and I see the error described above

It is worth mentioning that after the comparison, I found that we have different performances about ScriptResource.axd and WebResource.axd. His request to obtain these two files is normal, and my return is

Cannot find the specified user. Please verify your login information.

I read the answers from the article below, but it doesn't seem to work for me, can anyone help with this? Sys is undefined

Thanks!

Wwww24115
  • 35
  • 7

1 Answers1

0

use json+html solve the problem.

Wwww24115
  • 35
  • 7
  • And some explain of how you did this might help then??? – Albert D. Kallal Jun 27 '22 at 15:30
  • I choose to abandon this UpdatePanel and write another html and js code to achieve this function – Wwww24115 Jun 27 '22 at 15:35
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 28 '22 at 00:06