Hiding the tr in asp.net [Resolved]

Posted by Vuyiswamb under ASP.NET AJAX on 3/10/2012 | Points: 10 | Views : 6841 | Status : [Member] [MVP] [Administrator] | Replies : 2
Good day all

i have a strange issue here.

i have a table row defined like this



<tr id="tr6_3" runat="server" visible='<%# CheckVisible() %>' >
<td>
</td>
<td>
<strong>10.10 Introduction of a Project </strong>
</td>
</tr>


and the Function defined on that server is like this

Public Function CheckVisible() As Boolean
Dim sqlcout As New StringBuilder()

sqlcout.Append("select Count(*) as [COUNT]")
sqlcout.Append(" from mytable")
sqlcout.Append(" where fieldid= '" + fieldid+ "'")

Dim drcount As DataRow = clsFunctions.returnaRow(sqlcout.ToString())
Dim Results As Boolean
If (drcount Is Nothing = False) Then
If (drcount("COUNT") = 0) Then

Results = False
Else
Results = True

End If
End If
Return Results

End Function


i have debuged this and it brings "0" but the Tr does not get hidden. i am i missing something here?

thanks

Thank you for posting at Dotnetfunda
[Administrator]



Responses

Posted by: Vuyiswamb on: 3/10/2012 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down

Resolved
that is similar to that , but i am doing this on html side. i resolved this by using changing it to

return  "Style:Display: None"




Thank you for posting at Dotnetfunda
[Administrator]

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Iluvdotnetfunda on: 3/10/2012 [Member] Starter | Points: 25

Up
0
Down
Instead of returning True/False why don't you just set the visible value to false/true by accessing the id of the row, something like

tr6_3.Visible = false;


Thanks

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response