السلام عليكم ورحمة الله
انا مبتدء باللغة شوي وعملت صفحة لوق إن ولكن لما احط البيانات واضغط دخول يحولني لصفحة خطاء هذا مفادها :
Server Error in '/Invo' 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) +358 System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +108 System.Web.UI.WebControls.TextBox.LoadPostData(String postDataKey, NameValueCollection postCollection) +22 System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.LoadPostDat a(String postDataKey, NameValueCollection postCollection) +11 System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +381 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2965
علما أن كود الدخول والاتصال هذا هو
Imports System.Data.SqlClient
Partial Class Admin_LoginAdControl
Inherits System.Web.UI.UserControl
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ConnString As String = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Invo.mdf;Integrated Security=True;User Instance=True"
Using Myconn As New Data.SqlClient.SqlConnection(ConnString)
Const sql As String = "Select *From Users"
Dim Mycmd As New Data.SqlClient.SqlCommand(sql, Myconn)
Dim MyDataSet As New Data.DataSet
Dim MyAdapter As New Data.SqlClient.SqlDataAdapter(Mycmd)
MyAdapter.Fill(MyDataSet)
CheckRows(MyDataSet, TextUser.Text, TextPuss.Text)
Myconn.Close()
End Using
End Sub
Private Sub CheckRows(ByVal dataset As Data.DataSet, ByVal UserName As String, ByVal Pussword As String)
Dim table As Data.DataTable
Dim row As Data.DataRow
For Each table In dataset.Tables
Next
For Each row In table.Rows
If row(2) = UserName And row(3) = Pussword Then
Response.Redirect("~Admin/Default.aspx")
End If
Next row
If Not row(2) = UserName Then
ErrorLog.Visible = True
End If
If Not row(3) = Pussword Then
ErrorLog.Visible = True
End If
End Sub
End Classبإنتظار مساعدتك يالغالين :(