Hi all,
Ive got a problem... I made a ASP.NET webpage. When i run it i've got this message:
---------------------------------------------------
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
Source Error:
Line 2: Partial Class _Default
Line 3: Inherits System.Web.UI.Page
[red]Line 4: Private Sub FactuurControle_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles FactuurControle.RowDataBound[/red]
Line 5: If e.Row.RowType = DataControlRowType.DataRow Then
Line 6: 'determine the value of the UnitsInStock field
-----------------------------------------------------
Here is the code
I don't get it.
Plz Help
TnQ TanTrazz
Ive got a problem... I made a ASP.NET webpage. When i run it i've got this message:
---------------------------------------------------
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
Source Error:
Line 2: Partial Class _Default
Line 3: Inherits System.Web.UI.Page
[red]Line 4: Private Sub FactuurControle_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles FactuurControle.RowDataBound[/red]
Line 5: If e.Row.RowType = DataControlRowType.DataRow Then
Line 6: 'determine the value of the UnitsInStock field
-----------------------------------------------------
Here is the code
Code:
Private Sub FactuurControle_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles FactuurControle.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'determine the value of the UnitsInStock field
Dim unitsInStock As Integer = _
Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, _
"diff"))
If unitsInStock < 0 Then
' color the background of the row yellow
e.Row.Cells(7).ForeColor = Drawing.Color.Red
e.Row.Cells(7).Font.Bold = True
Else
e.Row.Cells(7).ForeColor = Drawing.Color.Green
e.Row.Cells(7).Font.Bold = True
End If
End If
End Sub
I don't get it.
Plz Help
TnQ TanTrazz