nelly89 0 Newbie Poster

i have a problem why this code did not function??

Protected Sub GVPaparTugasan_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim litPurata1 As Literal = DirectCast(e.Row.FindControl("litPurata1"), Literal)
            Dim litJumlah1 As Literal = DirectCast(e.Row.FindControl("litJumlah1"), Literal)


            Dim Tugasan1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Tugasan1"))
            Dim Tugasan2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Tugasan2"))
            Dim Tugasan3 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Tugasan3"))

            Dim Jumlah As Double = 0.0
            Jumlah = (Tugasan1 + Tugasan2 + Tugasan3)
            litJumlah1.Text = Jumlah
            Dim Purata As Double = 0.0
            Purata = (Tugasan1 + Tugasan2 + Tugasan3) / 3
            litPurata1.Text = Purata

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If Jumlah < 3 Then
                e.Row.CssClass = "red"
            ElseIf Jumlah = 3 Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub

    Protected Sub GVPaparMakmal_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim Literal1 As Literal = DirectCast(e.Row.FindControl("Literal1"), Literal)
            Dim Literal2 As Literal = DirectCast(e.Row.FindControl("Literal2"), Literal)


            Dim Makmal1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Makmal1"))
            Dim Makmal2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Makmal2"))
            Dim Makmal3 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Makmal3"))
            Dim Makmal4 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Makmal4"))

            Dim Jumlah As Double = 0.0
            Jumlah = (Makmal1 + Makmal2 + Makmal3 + Makmal4)
            Literal1.Text = Jumlah
            Dim Purata As Double = 0.0
            Purata = (Makmal1 + Makmal2 + Makmal3 + Makmal4) / 4
            Literal2.Text = Purata

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If Jumlah < 3 Then
                e.Row.CssClass = "red"
            ElseIf Jumlah = 3 Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub

    Protected Sub GVPaparProjek_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim Literal3 As Literal = DirectCast(e.Row.FindControl("Literal3"), Literal)
            Dim Literal4 As Literal = DirectCast(e.Row.FindControl("Literal4"), Literal)


            Dim Projek1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Projek1"))
            Dim Projek2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Projek2"))


            Dim Jumlah As Double = 0.0
            Jumlah = (Projek1 + Projek2)
            Literal3.Text = Jumlah
            Dim Purata As Double = 0.0
            Purata = (Projek1 + Projek2) / 2
            Literal4.Text = Purata

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If Jumlah < 3 Then
                e.Row.CssClass = "red"
            ElseIf Jumlah = 3 Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub


    Protected Sub GVPaparUjian_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim Literal5 As Literal = DirectCast(e.Row.FindControl("Literal5"), Literal)
            Dim Literal6 As Literal = DirectCast(e.Row.FindControl("Literal6"), Literal)


            Dim Ujian1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Ujian1"))
            Dim Ujian2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Ujian2"))


            Dim Jumlah As Double = 0.0
            Jumlah = (Ujian1 + Ujian2)
            Literal5.Text = Jumlah
            Dim Purata As Double = 0.0
            Purata = (Ujian1 + Ujian2) / 2
            Literal6.Text = Purata

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If Jumlah < 3 Then
                e.Row.CssClass = "red"
            ElseIf Jumlah = 3 Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub


    Protected Sub GVPaparFinal_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim Literal7 As Literal = DirectCast(e.Row.FindControl("Literal7"), Literal)
            Dim Literal8 As Literal = DirectCast(e.Row.FindControl("Literal8"), Literal)


            Dim PeperiksaanAkhir As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "PeperiksaanAkhir"))


            Dim Jumlah As Double = 0.0
            Jumlah = PeperiksaanAkhir
            Literal7.Text = Jumlah
            Dim Purata As Double = 0.0
            Purata = PeperiksaanAkhir
            Literal8.Text = Purata

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If Jumlah < 3 Then
                e.Row.CssClass = "red"
            ElseIf Jumlah = 3 Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub

actually i want to display colour in row which is the colour is depends on the value i insert, but when i run in browser, nothing happen but the code for only this only success.the code on the top is not function.

Protected Sub GVPapar_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim litPurata As Literal = DirectCast(e.Row.FindControl("litPurata"), Literal)
            Dim litJumlah As Literal = DirectCast(e.Row.FindControl("litJumlah"), Literal)
            

            Dim Kuiz1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ1"))
            Dim Kuiz2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ2"))
            Dim Kuiz3 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ3"))
            Dim Kuiz4 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ4"))
            Dim Kuiz5 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ5"))
            Dim Jumlah As Double = 0.0
            Jumlah = (Kuiz1 + Kuiz2 + Kuiz3 + Kuiz4 + Kuiz5)
            litJumlah.Text = Jumlah
            Dim Purata As Double = 0.0
            Purata = (Kuiz1 + Kuiz2 + Kuiz3 + Kuiz4 + Kuiz5) / 25 * 5
            litPurata.Text = Purata


            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If Jumlah < 9 Then
                e.Row.CssClass = "red"
            ElseIf 10 < Jumlah < 15 Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If
        End If
    End Sub

actually the behind code is:

Imports System.Data
Imports System.Data.SqlClient

Partial Class pensyarah_papanpemuka2
    Inherits System.Web.UI.Page


    Protected Sub btnCarian_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCarian.Click
        lblsilamasukkan.Visible = False
        lblKodSubjek.Visible = False
        lblSeksyen.Visible = False
        lblKeputusan.Visible = True
        DropDownList1.Visible = False
        DropDownList2.Visible = False
        btnCarian.Visible = False
        GridView1.Visible = True
        btnKembali.Visible = False


    End Sub

    Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
     
    End Sub

    Protected Sub DropDownList3_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)

        Dim DropDownList3 As DropDownList = CType(sender, DropDownList)


        Dim con As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFileName=|DataDirectory|\sistempppk.mdf;Integrated Security=True;User Instance=True")
        Dim strinsert As String
        Dim cmd As SqlCommand

        strinsert = "INSERT INTO kerjakursus (JenisKerjaKursus) values (@JenisKerjaKursus)"
        cmd = New SqlCommand(strinsert, con)
        con.Open()
        cmd.Parameters.AddWithValue("@JenisKerjaKursus", DropDownList3.SelectedValue)
        If DropDownList3.SelectedValue = "Kuiz" Then
            GVPapar.Visible = True
            GVPaparTugasan.Visible = False
            GVPaparMakmal.Visible = False
            GVPaparProjek.Visible = False
            GVPaparUjian.Visible = False
            GVPaparFinal.Visible = False
            GridView1.Visible = False
            btnKembali.Visible = True
            GridView1.Visible = False


            Exit Sub
        ElseIf DropDownList3.Text = "Tugasan" Then
            GVPaparTugasan.Visible = True
            GVPapar.Visible = False
            GVPaparMakmal.Visible = False
            GVPaparProjek.Visible = False
            GVPaparUjian.Visible = False
            GVPaparFinal.Visible = False
            btnKembaliTugasan.Visible = True
            GridView1.Visible = False
            Exit Sub

        ElseIf DropDownList3.Text = "Makmal" Then
            GVPaparMakmal.Visible = True
            GVPapar.Visible = False
            GVPaparTugasan.Visible = False
            GVPaparProjek.Visible = False
            GVPaparUjian.Visible = False
            GVPaparFinal.Visible = False
            btnKembaliMakmal.Visible = True
            GridView1.Visible = False
            Exit Sub
        ElseIf DropDownList3.Text = "Projek" Then
            GVPaparProjek.Visible = True
            GVPapar.Visible = False
            GVPaparTugasan.Visible = False
            GVPaparMakmal.Visible = False
            GVPaparUjian.Visible = False
            GVPaparFinal.Visible = False
            btnKembaliProjek.Visible = True
            GridView1.Visible = False
            Exit Sub
        ElseIf DropDownList3.Text = "Ujian" Then
            GVPaparUjian.Visible = True
            GVPapar.Visible = False
            GVPaparTugasan.Visible = False
            GVPaparMakmal.Visible = False
            GVPaparProjek.Visible = False
            GVPaparFinal.Visible = False
            btnKembaliUjian.Visible = True
            GridView1.Visible = False
            Exit Sub
        Else
            GVPaparFinal.Visible = True
            GVPapar.Visible = False
            GVPaparTugasan.Visible = False
            GVPaparMakmal.Visible = False
            GVPaparProjek.Visible = False
            GVPaparUjian.Visible = False
            btnKembaliFinal.Visible = True
            GridView1.Visible = False
            Exit Sub



            cmd.ExecuteNonQuery()
            cmd.Parameters.Clear()

            con.Close()
        End If

    End Sub


    Protected Sub GVPapar_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GVPapar.SelectedIndexChanged

    End Sub
    Protected Sub GVPapar_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim litPurata As Literal = DirectCast(e.Row.FindControl("litPurata"), Literal)
            Dim litJumlah As Literal = DirectCast(e.Row.FindControl("litJumlah"), Literal)
            

            Dim Kuiz1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ1"))
            Dim Kuiz2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ2"))
            Dim Kuiz3 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ3"))
            Dim Kuiz4 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ4"))
            Dim Kuiz5 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ5"))
            Dim Jumlah As Double = 0.0
            Jumlah = (Kuiz1 + Kuiz2 + Kuiz3 + Kuiz4 + Kuiz5)
            litJumlah.Text = Jumlah
            Dim Purata As Double = 0.0
            Purata = (Kuiz1 + Kuiz2 + Kuiz3 + Kuiz4 + Kuiz5) / 25 * 5
            litPurata.Text = Purata


            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If Jumlah < 9 Then
                e.Row.CssClass = "red"
            ElseIf 10 < Jumlah < 15 Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If
        End If
    End Sub






    Protected Sub GVPaparTugasan_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GVPaparMakmal.SelectedIndexChanged

    End Sub

    Protected Sub lnkbtnExport_Click(ByVal sender As Object, ByVal e As EventArgs)
        ExportGV(GVPapar)
    End Sub

    Protected Sub ExportGV(ByVal gvRef As GridView)
        Dim dt As DateTime = DateTime.Now
        Dim strFileName As String = "Papar Kuiz.csv"
        Dim strAttachment As String = "attachment; filename=" & strFileName

        Response.Clear()
        Response.Buffer = True
        Response.AddHeader("content-disposition", strAttachment)
        Response.Charset = ""
        Response.ContentType = "application/text"

        Dim dv As New DataView()
        dv = DirectCast(Session("Papar Kuiz"), DataView)

        gvRef.AllowPaging = False
        gvRef.DataSource = dv
        gvRef.DataBind()

        Dim intColHide As Integer = gvRef.Columns.Count - 1

        For i As Integer = 0 To gvRef.Columns.Count - 1
            If gvRef.HeaderRow.Cells(i).CssClass = "hiddenCol" Then
                gvRef.HeaderRow.Cells(i).CssClass = "showCol"
            End If

            gvRef.HeaderRow.Cells(i).Enabled = False
        Next

        gvRef.HeaderRow.Cells(intColHide).Visible = False

        For i As Integer = 0 To gvRef.Rows.Count - 1
            Dim row As GridViewRow = gvRef.Rows(i)

            For j As Integer = 0 To gvRef.Columns.Count - 1
                If row.Cells(j).CssClass = "hiddenCol" Then
                    row.Cells(j).CssClass = "showCol"
                End If
            Next
        Next

        gvRef.Columns(intColHide).Visible = False

        Dim sb As New StringBuilder()
        For i As Integer = 0 To gvRef.Columns.Count - 1
            If i <> intColHide Then
                sb.Append(gvRef.Columns(i).HeaderText + "|"c)
            End If
        Next

        sb.Append(vbCr & vbLf)
        For i As Integer = 0 To gvRef.Rows.Count - 1
            For j As Integer = 0 To gvRef.Columns.Count - 1
                If j <> intColHide Then
                    If gvRef.Columns(j).HeaderText = "NO." Then
                        Dim litNo As Literal = DirectCast(gvRef.Rows(i).Cells(j).FindControl("litNo"), Literal)
                        sb.Append(litNo.Text + "|"c)
                    ElseIf gvRef.Columns(j).HeaderText = "ACTIVE" Then
                        Dim litActive As Literal = DirectCast(gvRef.Rows(i).Cells(j).FindControl("litActive"), Literal)
                        sb.Append(litActive.Text + "|"c)
                    Else
                        sb.Append(gvRef.Rows(i).Cells(j).Text + "|"c)
                    End If
                End If
            Next

            sb.Append(vbCr & vbLf)
        Next

        sb.Replace("&nbsp;", "")

        Response.Output.Write(sb.ToString())
        Response.Flush()
        Response.[End]()
    End Sub

    Protected Sub btnKembali_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnKembali.Click
        GridView1.Visible = True
        GVPapar.Visible = False
        GVPaparTugasan.Visible = False
        GVPaparMakmal.Visible = False
        GVPaparProjek.Visible = False
        GVPaparUjian.Visible = False
        GVPaparFinal.Visible = False
        btnKembali.Visible = False
        btnKembaliTugasan.Visible = False
        btnKembaliMakmal.Visible = False
        btnKembaliProjek.Visible = False
        btnKembaliUjian.Visible = False
        btnKembaliFinal.Visible = False


    End Sub

    Protected Sub btnKembaliTugasan_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnKembaliTugasan.Click
        GridView1.Visible = True
        GVPapar.Visible = False
        GVPaparTugasan.Visible = False
        GVPaparMakmal.Visible = False
        GVPaparProjek.Visible = False
        GVPaparUjian.Visible = False
        GVPaparFinal.Visible = False
        btnKembali.Visible = False
        btnKembaliTugasan.Visible = False
        btnKembaliMakmal.Visible = False
        btnKembaliProjek.Visible = False
        btnKembaliUjian.Visible = False
        btnKembaliFinal.Visible = False
    End Sub

    Protected Sub btnKembaliMakmal_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnKembaliMakmal.Click
        GridView1.Visible = True
        GVPapar.Visible = False
        GVPaparTugasan.Visible = False
        GVPaparMakmal.Visible = False
        GVPaparProjek.Visible = False
        GVPaparUjian.Visible = False
        GVPaparFinal.Visible = False
        btnKembali.Visible = False
        btnKembaliTugasan.Visible = False
        btnKembaliMakmal.Visible = False
        btnKembaliProjek.Visible = False
        btnKembaliUjian.Visible = False
        btnKembaliFinal.Visible = False
    End Sub

    Protected Sub btnKembaliFinal_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnKembaliFinal.Click
        GridView1.Visible = True
        GVPapar.Visible = False
        GVPaparTugasan.Visible = False
        GVPaparMakmal.Visible = False
        GVPaparProjek.Visible = False
        GVPaparUjian.Visible = False
        GVPaparFinal.Visible = False
        btnKembali.Visible = False
        btnKembaliTugasan.Visible = False
        btnKembaliMakmal.Visible = False
        btnKembaliProjek.Visible = False
        btnKembaliUjian.Visible = False
        btnKembaliFinal.Visible = False
    End Sub

    Protected Sub btnKembaliUjian_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnKembaliUjian.Click
        GridView1.Visible = True
        GVPapar.Visible = False
        GVPaparTugasan.Visible = False
        GVPaparMakmal.Visible = False
        GVPaparProjek.Visible = False
        GVPaparUjian.Visible = False
        GVPaparFinal.Visible = False
        btnKembali.Visible = False
        btnKembaliTugasan.Visible = False
        btnKembaliMakmal.Visible = False
        btnKembaliProjek.Visible = False
        btnKembaliUjian.Visible = False
        btnKembaliFinal.Visible = False
    End Sub

    Protected Sub btnKembaliProjek_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnKembaliProjek.Click
        GridView1.Visible = True
        GVPapar.Visible = False
        GVPaparTugasan.Visible = False
        GVPaparMakmal.Visible = False
        GVPaparProjek.Visible = False
        GVPaparUjian.Visible = False
        GVPaparFinal.Visible = False
        btnKembali.Visible = False
        btnKembaliTugasan.Visible = False
        btnKembaliMakmal.Visible = False
        btnKembaliProjek.Visible = False
        btnKembaliUjian.Visible = False
        btnKembaliFinal.Visible = False
    End Sub

    Protected Sub GVPaparTugasan_SelectedIndexChanged1(ByVal sender As Object, ByVal e As System.EventArgs) Handles GVPaparTugasan.SelectedIndexChanged

    End Sub
    Protected Sub GVPaparTugasan_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim litPurata1 As Literal = DirectCast(e.Row.FindControl("litPurata1"), Literal)
            Dim litJumlah1 As Literal = DirectCast(e.Row.FindControl("litJumlah1"), Literal)


            Dim Tugasan1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Tugasan1"))
            Dim Tugasan2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Tugasan2"))
            Dim Tugasan3 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Tugasan3"))

            Dim Jumlah As Double = 0.0
            Jumlah = (Tugasan1 + Tugasan2 + Tugasan3)
            litJumlah1.Text = Jumlah
            Dim Purata As Double = 0.0
            Purata = (Tugasan1 + Tugasan2 + Tugasan3) / 3
            litPurata1.Text = Purata

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If Jumlah < 3 Then
                e.Row.CssClass = "red"
            ElseIf Jumlah = 3 Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub

    Protected Sub GVPaparMakmal_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim Literal1 As Literal = DirectCast(e.Row.FindControl("Literal1"), Literal)
            Dim Literal2 As Literal = DirectCast(e.Row.FindControl("Literal2"), Literal)


            Dim Makmal1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Makmal1"))
            Dim Makmal2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Makmal2"))
            Dim Makmal3 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Makmal3"))
            Dim Makmal4 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Makmal4"))

            Dim Jumlah As Double = 0.0
            Jumlah = (Makmal1 + Makmal2 + Makmal3 + Makmal4)
            Literal1.Text = Jumlah
            Dim Purata As Double = 0.0
            Purata = (Makmal1 + Makmal2 + Makmal3 + Makmal4) / 4
            Literal2.Text = Purata

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If Jumlah < 3 Then
                e.Row.CssClass = "red"
            ElseIf Jumlah = 3 Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub

    Protected Sub GVPaparProjek_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim Literal3 As Literal = DirectCast(e.Row.FindControl("Literal3"), Literal)
            Dim Literal4 As Literal = DirectCast(e.Row.FindControl("Literal4"), Literal)


            Dim Projek1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Projek1"))
            Dim Projek2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Projek2"))


            Dim Jumlah As Double = 0.0
            Jumlah = (Projek1 + Projek2)
            Literal3.Text = Jumlah
            Dim Purata As Double = 0.0
            Purata = (Projek1 + Projek2) / 2
            Literal4.Text = Purata

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If Jumlah < 3 Then
                e.Row.CssClass = "red"
            ElseIf Jumlah = 3 Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub


    Protected Sub GVPaparUjian_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim Literal5 As Literal = DirectCast(e.Row.FindControl("Literal5"), Literal)
            Dim Literal6 As Literal = DirectCast(e.Row.FindControl("Literal6"), Literal)


            Dim Ujian1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Ujian1"))
            Dim Ujian2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Ujian2"))


            Dim Jumlah As Double = 0.0
            Jumlah = (Ujian1 + Ujian2)
            Literal5.Text = Jumlah
            Dim Purata As Double = 0.0
            Purata = (Ujian1 + Ujian2) / 2
            Literal6.Text = Purata

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If Jumlah < 3 Then
                e.Row.CssClass = "red"
            ElseIf Jumlah = 3 Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub


    Protected Sub GVPaparFinal_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim Literal7 As Literal = DirectCast(e.Row.FindControl("Literal7"), Literal)
            Dim Literal8 As Literal = DirectCast(e.Row.FindControl("Literal8"), Literal)


            Dim PeperiksaanAkhir As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "PeperiksaanAkhir"))


            Dim Jumlah As Double = 0.0
            Jumlah = PeperiksaanAkhir
            Literal7.Text = Jumlah
            Dim Purata As Double = 0.0
            Purata = PeperiksaanAkhir
            Literal8.Text = Purata

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If Jumlah < 3 Then
                e.Row.CssClass = "red"
            ElseIf Jumlah = 3 Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub

    Protected Sub SqlDataSource8_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles SqlDataSource8.Selecting

    End Sub

    Protected Sub GVPaparFinal_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GVPaparFinal.SelectedIndexChanged

    End Sub
End Class

and the infront code is:

<%@ Page Language="VB" Debug="True" MasterPageFile="~/pensyarah/pensyarah.master" AutoEventWireup="false" CodeFile="papanpemuka2.aspx.vb" Inherits="pensyarah_papanpemuka2" title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
        <asp:Label ID="lblsilamasukkan" runat="server" 
            Text="Sila masukkan maklumat di bawah :" Font-Bold="True"></asp:Label>
        &nbsp;&nbsp;
        <table style="width:100%;">
            <tr>
                <td style="width: 193px">
                    <asp:Label ID="lblKodSubjek" runat="server" Text="KodSubjek : "></asp:Label>
                    <asp:DropDownList ID="DropDownList1" runat="server" 
                        DataSourceID="SqlDataSource1" DataTextField="KodSubjek" 
                        DataValueField="KodSubjek">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        SelectCommand="SELECT [KodSubjek] FROM [DaftarSubjek]"></asp:SqlDataSource>
                </td>
                <td style="width: 160px">
                    <asp:Label ID="lblSeksyen" runat="server" Text="Seksyen : "></asp:Label>
                    <asp:DropDownList ID="DropDownList2" runat="server" DataTextField="Seksyen" 
                        DataValueField="Seksyen" Height="16px">
                        <asp:ListItem>Sila Pilih</asp:ListItem>
                        <asp:ListItem>1</asp:ListItem>
                        <asp:ListItem>2</asp:ListItem>
                        <asp:ListItem>3</asp:ListItem>
                        <asp:ListItem>4</asp:ListItem>
                        <asp:ListItem>5</asp:ListItem>
                        <asp:ListItem>6</asp:ListItem>
                        <asp:ListItem>7</asp:ListItem>
                        <asp:ListItem>8</asp:ListItem>
                        <asp:ListItem>9</asp:ListItem>
                        <asp:ListItem>10</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    <asp:Button ID="btnCarian" runat="server" Text="Carian" />
                </td>
            </tr>
            <tr>
                <td colspan="3">
                <table border="1" style="width: 41%; height: 75px;" align="center">
                    <tr>
                        <td colspan="4">
                            <b>Skor Tahap Pencapaian Pelajar</b></td>
                    </tr>
                    <tr>
                        <td style="width: 64px">
                            Skor</td>
                        <td style="width: 60px">
                            Lemah</td>
                        <td style="width: 65px">
                            Sederhana</td>
                        <td style="width: 69px">
                            Baik</td>
                    </tr>
                    <tr>
                        <td style="width: 64px">
                            Tahap</td>
                        <td bgcolor="#FF0000" style="width: 60px">
                            &nbsp;</td>
                        <td bgcolor="#FFFF00" style="width: 65px">
                            &nbsp;</td>
                        <td bgcolor="#5FFB17" style="width: 69px">
                            &nbsp;</td>
                    </tr>
                </table>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:Label ID="lblKeputusan" runat="server" Text="Keputusan : " Visible="False"></asp:Label>
                </td>
            </tr>
            <tr>
                <td colspan="3" bgcolor="White">
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                        DataKeyNames="KodSubjek,Seksyen" DataSourceID="SqlDataSource3" Visible="False">
                        <Columns>
                            <asp:BoundField DataField="NamaSubjek" HeaderText="NamaSubjek" 
                                SortExpression="NamaSubjek" />
                            <asp:BoundField DataField="KodSubjek" HeaderText="KodSubjek" ReadOnly="True" 
                                SortExpression="KodSubjek" />
                            <asp:BoundField DataField="Seksyen" HeaderText="Seksyen" ReadOnly="True" 
                                SortExpression="Seksyen" />
                            <asp:TemplateField HeaderText="Jenis Kerja Kursus">
                                <ItemTemplate>
                                    <asp:DropDownList ID="DropDownList3" runat="server" 
                                        onselectedindexchanged="DropDownList3_SelectedIndexChanged">
                                        <asp:ListItem>Sila Pilih</asp:ListItem>
                                        <asp:ListItem>Kuiz</asp:ListItem>
                                        <asp:ListItem>Tugasan</asp:ListItem>
                                        <asp:ListItem>Makmal</asp:ListItem>
                                        <asp:ListItem>Projek</asp:ListItem>
                                        <asp:ListItem>Ujian</asp:ListItem>
                                        <asp:ListItem>Peperiksaan Akhir</asp:ListItem>
                                    </asp:DropDownList>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField ShowEditButton="True" />
                        </Columns>
                        <EmptyDataTemplate>
                            NamaSubjek
                        </EmptyDataTemplate>
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        DeleteCommand="DELETE FROM [Kuiz] WHERE [NoKadPengenalan] = @NoKadPengenalan AND [KodSubjek] = @KodSubjek AND [Seksyen] = @Seksyen" 
                        InsertCommand="INSERT INTO [Kuiz] ([Bil], [NamaPelajar], [NoKadPengenalan], [KodSubjek], [Seksyen], [Kuiz1], [Kuiz2], [Kuiz3], [Kuiz4], [Kuiz5], [Jumlah], [Purata]) VALUES (@Bil, @NamaPelajar, @NoKadPengenalan, @KodSubjek, @Seksyen, @Kuiz1, @Kuiz2, @Kuiz3, @Kuiz4, @Kuiz5, @Jumlah, @Purata)" 
                        SelectCommand="SELECT * FROM [Kuiz] WHERE (([KodSubjek] LIKE '%' + @KodSubjek + '%') AND ([Seksyen] LIKE '%' + @Seksyen + '%'))" 
                        UpdateCommand="UPDATE [Kuiz] SET [Bil] = @Bil, [NamaPelajar] = @NamaPelajar, [Kuiz1] = @Kuiz1, [Kuiz2] = @Kuiz2, [Kuiz3] = @Kuiz3, [Kuiz4] = @Kuiz4, [Kuiz5] = @Kuiz5, [Jumlah] = @Jumlah, [Purata] = @Purata WHERE [NoKadPengenalan] = @NoKadPengenalan AND [KodSubjek] = @KodSubjek AND [Seksyen] = @Seksyen">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="DropDownList1" Name="KodSubjek" 
                                PropertyName="SelectedValue" Type="String" />
                            <asp:ControlParameter ControlID="DropDownList2" Name="Seksyen" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                        <DeleteParameters>
                            <asp:Parameter Name="NoKadPengenalan" Type="String" />
                            <asp:Parameter Name="KodSubjek" Type="String" />
                            <asp:Parameter Name="Seksyen" Type="String" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="Bil" Type="Int32" />
                            <asp:Parameter Name="NamaPelajar" Type="String" />
                            <asp:Parameter Name="Kuiz1" Type="String" />
                            <asp:Parameter Name="Kuiz2" Type="String" />
                            <asp:Parameter Name="Kuiz3" Type="String" />
                            <asp:Parameter Name="Kuiz4" Type="String" />
                            <asp:Parameter Name="Kuiz5" Type="String" />
                            <asp:Parameter Name="Jumlah" Type="String" />
                            <asp:Parameter Name="Purata" Type="String" />
                            <asp:Parameter Name="NoKadPengenalan" Type="String" />
                            <asp:Parameter Name="KodSubjek" Type="String" />
                            <asp:Parameter Name="Seksyen" Type="String" />
                        </UpdateParameters>
                        <InsertParameters>
                            <asp:Parameter Name="Bil" Type="Int32" />
                            <asp:Parameter Name="NamaPelajar" Type="String" />
                            <asp:Parameter Name="NoKadPengenalan" Type="String" />
                            <asp:Parameter Name="KodSubjek" Type="String" />
                            <asp:Parameter Name="Seksyen" Type="String" />
                            <asp:Parameter Name="Kuiz1" Type="String" />
                            <asp:Parameter Name="Kuiz2" Type="String" />
                            <asp:Parameter Name="Kuiz3" Type="String" />
                            <asp:Parameter Name="Kuiz4" Type="String" />
                            <asp:Parameter Name="Kuiz5" Type="String" />
                            <asp:Parameter Name="Jumlah" Type="String" />
                            <asp:Parameter Name="Purata" Type="String" />
                        </InsertParameters>
                    </asp:SqlDataSource>
                    
                    <asp:GridView ID="GVPapar" runat="server" AutoGenerateColumns="False" 
                        DataKeyNames="NoKadPengenalan,KodSubjek,Seksyen" DataSourceID="SqlDataSource4" 
                        Visible="False" OnRowDataBound="GVPapar_RowDataBound">
                        <Columns>
                            <asp:BoundField DataField="NamaPelajar" HeaderText="NamaPelajar" 
                                SortExpression="NamaPelajar" />
                            <asp:BoundField DataField="NoKadPengenalan" HeaderText="NoKadPengenalan" 
                                ReadOnly="True" SortExpression="NoKadPengenalan" />
                            <asp:TemplateField HeaderText="Kuiz1 (5)" SortExpression="Kuiz1">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Kuiz1") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("Kuiz1") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Kuiz2 (5)" SortExpression="Kuiz2">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Kuiz2") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("Kuiz2") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Kuiz3 (5)" SortExpression="Kuiz3">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Kuiz3") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("Kuiz3") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Kuiz4 (5)" SortExpression="Kuiz4">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("Kuiz4") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("Kuiz4") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Kuiz5 (5)" SortExpression="Kuiz5">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("Kuiz5") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label7" runat="server" Text='<%# Bind("Kuiz5") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Jumlah (25)" SortExpression="Jumlah">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Jumlah") %>'></asp:TextBox>
                                </EditItemTemplate>
                                
                                <ItemTemplate>
                                <asp:Literal ID="litJumlah" runat="server"></asp:Literal>
                               
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Purata" SortExpression="Purata" ItemStyle-CssClass="aa">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Purata") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Literal ID="litPurata" runat="server"></asp:Literal>
                                </ItemTemplate>

<ItemStyle CssClass="aa"></ItemStyle>
                            </asp:TemplateField>
                            <asp:CommandField ShowEditButton="True" EditText="Kemaskini" />
                        </Columns>
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        DeleteCommand="DELETE FROM [kerjakursus] WHERE [KodSubjek] = @KodSubjek AND [Seksyen] = @Seksyen" 
                        InsertCommand="INSERT INTO [kerjakursus] ([NamaSubjek], [KodSubjek], [Seksyen]) VALUES (@NamaSubjek, @KodSubjek, @Seksyen)" 
                        SelectCommand="SELECT [NamaSubjek], [KodSubjek], [Seksyen] FROM [kerjakursus] WHERE (([KodSubjek] LIKE '%' + @KodSubjek + '%') AND ([Seksyen] LIKE '%' + @Seksyen + '%'))" 
                        UpdateCommand="UPDATE [kerjakursus] SET [NamaSubjek] = @NamaSubjek WHERE [KodSubjek] = @KodSubjek AND [Seksyen] = @Seksyen">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="DropDownList1" Name="KodSubjek" 
                                PropertyName="SelectedValue" Type="String" />
                            <asp:ControlParameter ControlID="DropDownList2" Name="Seksyen" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                        <DeleteParameters>
                            <asp:Parameter Name="KodSubjek" Type="String" />
                            <asp:Parameter Name="Seksyen" Type="String" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="NamaSubjek" Type="String" />
                            <asp:Parameter Name="KodSubjek" Type="String" />
                            <asp:Parameter Name="Seksyen" Type="String" />
                        </UpdateParameters>
                        <InsertParameters>
                            <asp:Parameter Name="NamaSubjek" Type="String" />
                            <asp:Parameter Name="KodSubjek" Type="String" />
                            <asp:Parameter Name="Seksyen" Type="String" />
                        </InsertParameters>
                    </asp:SqlDataSource>
                    
                    <asp:Button ID="btnKembali" runat="server" Text="Kembali" Visible="False" />
                    
                    <asp:GridView ID="GVPaparTugasan" runat="server" AutoGenerateColumns="False" 
                        DataKeyNames="NoKadPengenalan,KodSubjek,Seksyen" DataSourceID="SqlDataSource5" 
                        Visible="False">
                        <Columns>
                            <asp:BoundField DataField="NamaPelajar" HeaderText="NamaPelajar" 
                                SortExpression="NamaPelajar" />
                            <asp:BoundField DataField="NoKadPengenalan" HeaderText="NoKadPengenalan" 
                                ReadOnly="True" SortExpression="NoKadPengenalan" />
                            <asp:TemplateField HeaderText="Tugasan1 " SortExpression="Tugasan1">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Tugasan1") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Tugasan1") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tugasan2 " SortExpression="Tugasan2">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Tugasan2") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Tugasan2") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tugasan3 " SortExpression="Tugasan3">
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("Tugasan3") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Tugasan3") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Jumlah (5%)" SortExpression="Jumlah">
                             
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Jumlah") %>'></asp:TextBox>
                                </EditItemTemplate>
                                 <ItemTemplate>
                                <asp:Literal ID="litJumlah1" runat="server"></asp:Literal>
                               
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Purata" SortExpression="Purata" ItemStyle-CssClass="aa">
                                
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Purata") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                <asp:Literal ID="litPurata1" runat="server"></asp:Literal>
                               
                                </ItemTemplate>
 <ItemStyle CssClass="aa"></ItemStyle>
                            </asp:TemplateField>
                            <asp:CommandField EditText="Kemaskini" ShowEditButton="True" />
                        </Columns>
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        DeleteCommand="DELETE FROM [Tugasan] WHERE [NoKadPengenalan] = @NoKadPengenalan AND [KodSubjek] = @KodSubjek AND [Seksyen] = @Seksyen" 
                        InsertCommand="INSERT INTO [Tugasan] ([NamaPelajar], [NoKadPengenalan], [KodSubjek], [Seksyen], [Tugasan1], [Tugasan2], [Tugasan3], [Jumlah], [Purata]) VALUES (@NamaPelajar, @NoKadPengenalan, @KodSubjek, @Seksyen, @Tugasan1, @Tugasan2, @Tugasan3, @Jumlah, @Purata)" 
                        SelectCommand="SELECT * FROM [Tugasan] WHERE (([KodSubjek] LIKE '%' + @KodSubjek + '%') AND ([Seksyen] LIKE '%' + @Seksyen + '%'))" 
                        UpdateCommand="UPDATE [Tugasan] SET [NamaPelajar] = @NamaPelajar, [Tugasan1] = @Tugasan1, [Tugasan2] = @Tugasan2, [Tugasan3] = @Tugasan3, [Jumlah] = @Jumlah, [Purata] = @Purata WHERE [NoKadPengenalan] = @NoKadPengenalan AND [KodSubjek] = @KodSubjek AND [Seksyen] = @Seksyen">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="DropDownList1" Name="KodSubjek" 
                                PropertyName="SelectedValue" Type="String" />
                            <asp:ControlParameter ControlID="DropDownList2" Name="Seksyen" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                        <DeleteParameters>
                            <asp:Parameter Name="NoKadPengenalan" Type="String" />
                            <asp:Parameter Name="KodSubjek" Type="String" />
                            <asp:Parameter Name="Seksyen" Type="String" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="NamaPelajar" Type="String" />
                            <asp:Parameter Name="Tugasan1" Type="String" />
                            <asp:Parameter Name="Tugasan2" Type="String" />
                            <asp:Parameter Name="Tugasan3" Type="String" />
                            <asp:Parameter Name="Jumlah" Type="String" />
                            <asp:Parameter Name="Purata" Type="String" />
                            <asp:Parameter Name="NoKadPengenalan" Type="String" />
                            <asp:Parameter Name="KodSubjek" Type="String" />
                            <asp:Parameter Name="Seksyen" Type="String" />
                        </UpdateParameters>
                        <InsertParameters>
                            <asp:Parameter Name="NamaPelajar" Type="String" />
                            <asp:Parameter Name="NoKadPengenalan" Type="String" />
                            <asp:Parameter Name="KodSubjek" Type="String" />
                            <asp:Parameter Name="Seksyen" Type="String" />
                            <asp:Parameter Name="Tugasan1" Type="String" />
                            <asp:Parameter Name="Tugasan2" Type="String" />
                            <asp:Parameter Name="Tugasan3" Type="String" />
                            <asp:Parameter Name="Jumlah" Type="String" />
                            <asp:Parameter Name="Purata" Type="String" />
                        </InsertParameters>
                    </asp:SqlDataSource>
                    <asp:Button ID="btnKembaliTugasan" runat="server" Text="Kembali" 
                        Visible="False" />
                    <asp:GridView ID="GVPaparMakmal" runat="server" AutoGenerateColumns="False" 
                        DataKeyNames="NoKadPengenalan,KodSubjek,Seksyen" DataSourceID="SqlDataSource6" 
                        Visible="False">
                        <Columns>
                            <asp:BoundField DataField="NamaPelajar" HeaderText="NamaPelajar" 
                                SortExpression="NamaPelajar" />
                            <asp:BoundField DataField="NoKadPengenalan" HeaderText="NoKadPengenalan" 
                                ReadOnly="True" SortExpression="NoKadPengenalan" />
                            <asp:TemplateField HeaderText="Makmal1 " SortExpression="Makmal1">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Makmal1") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Makmal1") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Makmal2" SortExpression="Makmal2">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Makmal2") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Makmal2") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Makmal3" SortExpression="Makmal3">
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("Makmal3") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Makmal3") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Makmal4" SortExpression="Makmal4">
                                <ItemTemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("Makmal4") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Makmal4") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Jumlah (15%)" SortExpression="Jumlah">
                                <ItemTemplate>
                                    <asp:Literal ID="Literal1" runat="server"></asp:Literal>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Jumlah") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Purata" SortExpression="Purata" ItemStyle-CssClass="aa">
                                <ItemTemplate>
                                    <asp:Literal ID="Literal2" runat="server"></asp:Literal>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("Purata") %>'></asp:TextBox>
                                </EditItemTemplate>
                              <ItemStyle CssClass="aa"></ItemStyle>
                               
                                                             
                            </asp:TemplateField>
                            <asp:CommandField EditText="Kemaskini" ShowEditButton="True" />
                        </Columns>
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        DeleteCommand="DELETE FROM [Makmal] WHERE [NoKadPengenalan] = @NoKadPengenalan AND [KodSubjek] = @KodSubjek AND [Seksyen] = @Seksyen" 
                        InsertCommand="INSERT INTO [Makmal] ([NamaPelajar], [NoKadPengenalan], [KodSubjek], [Seksyen], [Makmal1], [Makmal2], [Makmal3], [Makmal4], [Jumlah], [Purata]) VALUES (@NamaPelajar, @NoKadPengenalan, @KodSubjek, @Seksyen, @Makmal1, @Makmal2, @Makmal3, @Makmal4, @Jumlah, @Purata)" 
                        SelectCommand="SELECT * FROM [Makmal] WHERE (([KodSubjek] LIKE '%' + @KodSubjek + '%') AND ([Seksyen] LIKE '%' + @Seksyen + '%'))" 
                        UpdateCommand="UPDATE [Makmal] SET [NamaPelajar] = @NamaPelajar, [Makmal1] = @Makmal1, [Makmal2] = @Makmal2, [Makmal3] = @Makmal3, [Makmal4] = @Makmal4, [Jumlah] = @Jumlah, [Purata] = @Purata WHERE [NoKadPengenalan] = @NoKadPengenalan AND [KodSubjek] = @KodSubjek AND [Seksyen] = @Seksyen">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="DropDownList1" Name="KodSubjek" 
                                PropertyName="SelectedValue" Type="String" />
                            <asp:ControlParameter ControlID="DropDownList2" Name="Seksyen" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                        <DeleteParameters>
                            <asp:Parameter Name="NoKadPengenalan" Type="String" />
                            <asp:Parameter Name="KodSubjek" Type="String" />
                            <asp:Parameter Name="Seksyen" Type="String" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="NamaPelajar" Type="String" />
                            <asp:Parameter Name="Makmal1" Type="String" />
                            <asp:Parameter Name="Makmal2" Type="String" />
                            <asp:Parameter Name="Makmal3" Type="String" />
                            <asp:Parameter Name="Makmal4" Type="String" />
                            <asp:Parameter Name="Jumlah" Type="String" />
                            <asp:Parameter Name="Purata" Type="String" />
                            <asp:Parameter Name="NoKadPengenalan" Type="String" />
                            <asp:Parameter Name="KodSubjek" Type="String" />
                            <asp:Parameter Name="Seksyen" Type="String" />
                        </UpdateParameters>
                        <InsertParameters>
                            <asp:Parameter Name="NamaPelajar" Type="String" />
                            <asp:Parameter Name="NoKadPengenalan" Type="String" />
                            <asp:Parameter Name="KodSubjek" Type="String" />
                            <asp:Parameter Name="Seksyen" Type="String" />
                            <asp:Parameter Name="Makmal1" Type="String" />
                            <asp:Parameter Name="Makmal2" Type="String" />
                            <asp:Parameter Name="Makmal3" Type="String" />
                            <asp:Parameter Name="Makmal4" Type="String" />
                            <asp:Parameter Name="Jumlah" Type="String" />
                            <asp:Parameter Name="Purata" Type="String" />
                        </InsertParameters>
                    </asp:SqlDataSource>
                    <asp:Button ID="btnKembaliMakmal" runat="server" Text="Kembali" 
                        Visible="False" />
                    <asp:GridView ID="GVPaparProjek" runat="server" AutoGenerateColumns="False" 
                        DataKeyNames="NoKadPengenalan,KodSubjek,Seksyen" DataSourceID="SqlDataSource7" 
                        Visible="False">
                        <Columns>
                            <asp:BoundField DataField="NamaPelajar" HeaderText="NamaPelajar" 
                                SortExpression="NamaPelajar" />
                            <asp:BoundField DataField="NoKadPengenalan" HeaderText="NoKadPengenalan" 
                                ReadOnly="True" SortExpression="NoKadPengenalan" />
                            <asp:TemplateField HeaderText="Projek1 (10%)" SortExpression="Projek1">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Projek1") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Projek1") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Projek2 (10%)" SortExpression="Projek2">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Projek2") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Projek2") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Jumlah (20%)" SortExpression="Jumlah">
                                <ItemTemplate>
                                    <asp:Literal ID="Literal3" runat="server"></asp:Literal>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Jumlah") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Purata" SortExpression="Purata" ItemStyle-CssClass="aa">
                                <ItemTemplate>
                                    <asp:Literal ID="Literal4" runat="server"></asp:Literal>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Purata") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemStyle CssClass="aa"></ItemStyle>
                            </asp:TemplateField>
                            <asp:CommandField EditText="Kemaskini" ShowEditButton="True" />
                        </Columns>
                    &lt
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.