Когда я хочу войти в свой проект через Google Chrome, он показывает мне эту ошибку
Скриншот
Server Error in '/' Application.
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.]
System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +9851830
System.Web.UI.WebControls.TextBox.LoadPostData(String postDataKey, NameValueCollection postCollection) +126
System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +15
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +457
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1833
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2633.0
Вот мой web.config
<connectionStrings>
<!--<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>-->
<add name="PointofSaleConstr" connectionString="Data Source=(local); Initial Catalog=Pointofsale; User ID=posadmin;Password=posadmpw" providerName="System.Data.SqlClient"/>
</connectionStrings>
Код входа в систему .asp
protected void btnSubmit_Click(object sender, EventArgs e)
{
string UserID = txtuser.Text.Trim();
string pass = txtpass.Text.Trim();
string strcon = ConfigurationManager.ConnectionStrings["PointofSaleConstr"].ConnectionString;
SqlConnection con = new SqlConnection(strcon);
SqlCommand cmd = new SqlCommand("Sp_User_Authentication", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@LOGINID", UserID);
cmd.Parameters.AddWithValue("@PASSWORD", pass);
con.Open();
SqlDataReader rd = cmd.ExecuteReader();
if (rd.HasRows)
{
rd.Read();
lblLogMsg.Text = "Login successful.";
// //Session to Master Page
//Session["UserID"] = UserID;
// Session["ShopID"] = rd["ShopID"].ToString();
Response.Cookies["POSCookies"]["UserID"] = UserID;
Response.Cookies["POSCookies"]["ShopID"] = rd["ShopID"].ToString();
Response.Cookies["POSCookies"].Expires = DateTime.Now.AddDays(9965);
hitcounter();
Response.Redirect("Dashboard/Default.aspx", false);
//Query string
// Response.Redirect("Default.aspx?userID=" + UserID + "&ShopID=" + rd["ShopID"].ToString());
// Response.Redirect("Default.aspx?userID=" + HttpUtility.UrlEncode(Request.QueryString["UserID"]) + "&ShopID=" + rd["ShopID"].ToString());
}
else
{
lblLogMsg.Visible = true;
lblLogMsg.Text = "We don't recognize this user ID or password.";
}
con.Close();
}
public void hitcounter()
{
try
{
string ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
SqlConnection cn = new SqlConnection(ConnectionString);
SqlCommand cmd = new SqlCommand("SP_POS_Insert_HitCounter", cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@userID", txtuser.Text);
cmd.Parameters.AddWithValue("@IPaddress", ip);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
}
catch
{
}
}
}
это мой код login.asp, или я не знаю, почему он не позволяет мне войти в базу данных sql. Я также добавил базу данных в проект, но когда хочу войти, он показывает мне эту ошибку, я не знаю, какой файл мне нужно редактировать плохо надеюсь, что кто-нибудь может мне немного объяснить