母版:
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
ASPX页面:
<%@ Page Title="" Language="C#" MasterPageFile="~/NewFMaster.master" AutoEventWireup="true" CodeFile="Home17.aspx.cs" Inherits="Home17" %>
....
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
....
<form id="form1" runat="server">
<div class="form-group">
<div class="col-sm-6">
<asp:TextBox ID="txtFullName" runat="server" CssClass="name" placeholder="Full Name"></asp:TextBox>
</div>
<div class="col-sm-6">
<asp:TextBox ID="txtContact" runat="server" MaxLength="12" CssClass="name" placeholder="Contact Number" />
</div>
</div>
<asp:Button ID="submitButton" runat="server" CssClass="submit-btn" style="width:150px" Text="Submit" OnClick="submitButton_Click"/>
</form>
....
</asp:Content>
代码隐藏:
public partial class Home17 : System.Web.UI.MasterPage
{
....
protected void submitButton_Click(object sender, EventArgs e)
{
Response.Redirect("Home16.aspx");
}
如果我从asp:按钮行中删除 OnClick =&#34; submitButton_Click&#34; ,则至少会显示该页面,否则我会得到&#34;内部服务器错误&#34;
Web.Config:客户错误已关闭&amp;尝试使用true / false进行调试
2018年4月24日更新: 现在所有页面上都显示内部服务器错误。整个网站已经完成。
错误日志最后一个错误是: (我添加了新密钥)
<Error>
<Message>Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster,
ensure that <machineKey> configuration specifies the same validationKey and validation algorithm.
AutoGenerate cannot be used in a cluster.
http://go.microsoft.com/fwlink/?LinkID=314055</Message>
<PageName>http://www.***.*******.com/Product.aspx?productID=69584&productID=69584</PageName>
<Date>4/23/2018 8:58:44 PM</Date>
<UTC>4/24/2018 3:58:44 AM</UTC>
</Error>
注意:托管服务提供商是BigRock。 (已经向他们寻求帮助,但他们只是说我必须解决它,而不是他们的问题)