简体   繁体   中英

asp:button works locally but no on server

I have 4 asp:buttons on my web page. One of them works correctly the other three do not. The form on my web page is a simple encryption application. I am new to asp.net so any help would be greatly appreciated. The entire site works correctly locally of course but when uploaded on to the server 3 buttons don't work. I might be over looking something obvious but the sample code is below:

*Only the Encrypt button works. Generic error code for other buttons: ScriptResource.axd:5 Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    Enter Password: <asp:TextBox ID="TextBox1" MaxLength="15" CssClass="Password" runat="server"></asp:TextBox>
    <asp:FileUpload ID="FileUpload1" CssClass="Button" runat="server" />
    <asp:Button ID="Button1" runat="server" Text="Upload File" CssClass="Button" CausesValidation="False" onclick="Button1_Click" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <br />
    Enter Text:
    <br />
    <asp:TextBox ID="TextBox2" TextMode="MultiLine" CssClass="TestStyle"  runat="server"></asp:TextBox>
    <br />
    <%--<asp:TextBox ID="TextBox2" TextMode="MultiLine" CssClass="TestStyle" runat="server"></asp:TextBox>
    <br />--%>
    <asp:Button  ID="Encrypt" OnClick="EncryptBT_Click" runat="server" CssClass="Button"  CausesValidation="False" Text="Encrypt"></asp:Button>
    <asp:Button  ID="Decrypt" OnClick="DecryptBT_Click" runat="server"  CssClass="Button" CausesValidation="False" Text="Decrypt"></asp:Button>
    <fieldset>
    <legend>Save Encrypted Text File</legend>File name:
    <asp:TextBox ID="textboxName" runat="server" Width="93px"></asp:TextBox>
    <asp:Button ID="buttonSave" runat="server" Text="Save As" CssClass="Button" Width="66px" OnClick="Save_Click" /></fieldset>
    </ContentTemplate>
   </asp:UpdatePanel>
</form>

Check using developer Tools whether buttons are on the page or not.
Also, check whether their onClick method has been implemented or not in code -behind.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM