how to make radiobuttion visible false in repeater?
Diksha dudi
126
Reputation points
I am having 5 radio button in repeater and want to make it invisible when its text is nothing, but it is not working
aspx code:
vb.net code:
Imports System.Data
Imports System.Data.SqlClient
Partial Class Product_detailpage
Inherits System.Web.UI.Page
Dim user_id As Integer
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Me.pDetailsurl()
Me.pincode()
Me.prod_size()
End If
End Sub
Private Sub prod_size()
Dim value As String = ""
For Each item As RepeaterItem In durl.Items
If item.ItemType = ListItemType.AlternatingItem OrElse item.ItemType = ListItemType.Item Then
Dim rdb As RadioButton = TryCast(item.FindControl("RadioButton1"), RadioButton)
Dim rdb1 As RadioButton = TryCast(item.FindControl("RadioButton2"), RadioButton)
Dim rdb2 As RadioButton = TryCast(item.FindControl("RadioButton3"), RadioButton)
Dim rdb3 As RadioButton = TryCast(item.FindControl("RadioButton4"), RadioButton)
Dim rdb4 As RadioButton = TryCast(item.FindControl("RadioButton5"), RadioButton)
If rdb.Text Is Nothing Then
MsgBox("hyy")
rdb.Visible = False
End If
If rdb1.Text Is Nothing Then
rdb1.Visible = False
End If
If rdb2.Text Is Nothing Then
rdb2.Visible = False
End If
If rdb3.Text Is Nothing Then
rdb3.Visible = False
End If
If rdb4.Text Is Nothing Then
rdb4.Visible = False
End If
End If
Next
End Sub
output:
Sign in to answer