Protected Sub myGridView_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles myGridView.RowCommand
Dim myArr As Array = Session("path")
Dim myStr As String = ""
Dim i As Integer
For i = 0 To myArr.Length - 1
myStr &= myArr(i)
Next
If e.CommandName = "add" Then
Dim txtaddcourse_id As TextBox = CType(myGridView.FooterRow.FindControl("txtaddcourse_id"), TextBox)
Dim txtaddcourse_name As TextBox = CType(myGridView.FooterRow.FindControl("txtaddcourse_name"), TextBox)
Dim txtaddcredit As TextBox = CType(myGridView.FooterRow.FindControl("txtaddcredit"), TextBox)
Dim txtaddteacher As TextBox = CType(myGridView.FooterRow.FindControl("txtaddteacher"), TextBox)
Dim sql As String
Dim con As New Cls_Connect
sql = "insert into course (major_id,tqf_number,course_id,course_name,credit,group_subject,teacher)"
sql &= " values('" & myArr(1) & "','" & myArr(2) & "','" & txtaddcourse_id.Text & "','" & txtaddcourse_name.Text & "','" & txtaddcredit.Text & "','" & DropDownList1.Text & "','" & txtaddteacher.Text & "')"
con.connectData()
con.ExecuteNonQuery(sql)
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) +8628633
System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +69
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +35
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565