A
anonymous
I have mycontrol as custom control and I need to get some
data from a control
on a different page. My code is below. It is working
perfectly fine, but since
I have 10 more label to check is it some how I can make
this code is more
compact?
If CType(myconrtol.FindControl("lblCompany"),
Label).Visible = True Then
dr(0) = CType(myconrtol.FindControl
("lblCompany"), Label).Text()
dr(1) = myconrtol.Company
dt.Rows.Add(dr)
dr = dt.NewRow()
End If
If CType(myconrtol.FindControl("lblPlanName"),
Label).Visible = True Then
dr(0) = CType(myconrtol.FindControl
("lblPlanName"), Label).Text()
dr(1) = myconrtol.PlanName
dt.Rows.Add(dr)
dr = dt.NewRow()
End If
data from a control
on a different page. My code is below. It is working
perfectly fine, but since
I have 10 more label to check is it some how I can make
this code is more
compact?
If CType(myconrtol.FindControl("lblCompany"),
Label).Visible = True Then
dr(0) = CType(myconrtol.FindControl
("lblCompany"), Label).Text()
dr(1) = myconrtol.Company
dt.Rows.Add(dr)
dr = dt.NewRow()
End If
If CType(myconrtol.FindControl("lblPlanName"),
Label).Visible = True Then
dr(0) = CType(myconrtol.FindControl
("lblPlanName"), Label).Text()
dr(1) = myconrtol.PlanName
dt.Rows.Add(dr)
dr = dt.NewRow()
End If