我在gridview中有一个itemtemplate linkbutton。我想在linkbutton_Onclick
事件中设置点击的链接按钮字体粗体。
Protected Sub lblArtId_Onclick(ByVal sender As Object, ByVal e As EventArgs)
Dim clickedRow As GridViewRow = TryCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
lblArtId_temp_lnk = DirectCast(clickedRow.FindControl("lblArtId"), LinkButton)
'ViewState("lblArtId_temp_lnk") = lblArtId_temp_lnk
' lblArtId_temp_lnk.Font.Bold = False
Dim qry As String = ""
Dim str_Qry As String = String.Empty
Dim dt As DataTable = New DataTable
Dim dt_new As DataTable = New DataTable
Dim txt As String = ""
Dim obj As GridViewGroup
Dim lblArtId_lnk As LinkButton = DirectCast(clickedRow.FindControl("lblArtId"), LinkButton)
If ViewState("lblArtId_temp_lnk_cnt") > 0 Then
lblArtId_temp_lnk.Font.Bold = False
End If
ViewState("lblArtId_temp_lnk_cnt") += 1
End Sub
即,先前点击的链接按钮设置为正常,当前点击的链接按钮设置为字体粗体
建议我找一个解决方案。
提前致谢