Asp.net 来自网页的消息回发或回调参数无效。使用启用事件验证
我的目标是让用户能够单击该行,并且该行将是选中的行,就像使用“选择”按钮一样,但整行都可以单击以执行相同的操作 当我单击该行时,而不是在加载网页时,会出现弹出窗口错误 这是我刚才添加的导致错误的onrowdatabound部分Asp.net 来自网页的消息回发或回调参数无效。使用启用事件验证,asp.net,vb.net,Asp.net,Vb.net,我的目标是让用户能够单击该行,并且该行将是选中的行,就像使用“选择”按钮一样,但整行都可以单击以执行相同的操作 当我单击该行时,而不是在加载网页时,会出现弹出窗口错误 这是我刚才添加的导致错误的onrowdatabound部分 If e.Row.RowType = DataControlRowType.DataRow Then ' Get reference to button field in the gridview. Dim
If e.Row.RowType = DataControlRowType.DataRow Then
' Get reference to button field in the gridview.
Dim _singleClickButton As LinkButton = DirectCast(selectbutton, LinkButton)
Dim _jsSingle As String = ClientScript.GetPostBackClientHyperlink(_singleClickButton, "Select$" & Convert.ToString(e.Row.RowIndex))
e.Row.Style("cursor") = "hand"
e.Row.Attributes("onclick") = _jsSingle
End If
这是我的完整的rowdatabound
Protected Sub GridView6_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
' CHECK THE ROW TYPE HERE. ONLY EXECUTE ON DataRow
If e.Row.RowType = DataControlRowType.DataRow Then
Dim date1 As Date
date1 = Date.Now
Dim date2 As Date
Dim ddate As Label = CType(e.Row.FindControl("duedate"), Label)
date2 = Date.Parse(ddate.Text)
Dim ts As TimeSpan = date2.Subtract(date1)
Dim days As Integer = ts.TotalDays
If days <= 14 And days >= 0 Then
e.Row.ForeColor = System.Drawing.Color.Blue
bluecount = bluecount + 1
ElseIf days > 14 And days < 30 Then
e.Row.ForeColor = System.Drawing.Color.Black
blackcount = blackcount + 1
ElseIf days >= 30 Then
e.Row.ForeColor = System.Drawing.Color.Green
greencount = greencount + 1
ElseIf days < 0 Then
e.Row.ForeColor = System.Drawing.Color.Red
redcount = redcount + 1
End If
Dim link As HyperLink = CType(e.Row.FindControl("HyperLink1"), HyperLink)
Dim id As Label = CType(e.Row.FindControl("id"), Label)
Dim selectbutton As LinkButton = CType(e.Row.FindControl("linkbutton1"), LinkButton)
If e.Row.RowType = DataControlRowType.DataRow Then
' Get reference to button field in the gridview.
Dim _singleClickButton As LinkButton = DirectCast(selectbutton, LinkButton)
Dim _jsSingle As String = ClientScript.GetPostBackClientHyperlink(_singleClickButton, "Select$" & Convert.ToString(e.Row.RowIndex))
e.Row.Style("cursor") = "hand"
e.Row.Attributes("onclick") = _jsSingle
End If
link.NavigateUrl = "Default7.aspx?id=" + id.Text + "&uid=" + user1
pduecount.Text = redcount
next14count.Text = bluecount
fteencount.Text = blackcount
thirtycount.Text = greencount
End If
End Sub
在aspx页面标记的页面指令中将EnableEventValidation设置为False