M.L. Martin
asked on
Hide server controls if SQLDatasource empty or NULL
For a very long time I have tried to figure out how to hide a control like a asp textbox or asp dropdownlist if a sqldatasource is or is not a certain value. I want to do this without using asp.net server controls like gridview, detailview, datalist..etc. I simply want to do something like hide a control if the sqldatasource = 0 or no data return.
The following is as far as I have gotten but I need help. I am not even sure if this is correct.
Protected Sub StepDataShowArticle_Select ing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls. SqlDataSou rceSelecti ngEventArg s) Handles StepDataShowArticle.Select ing
End Sub
StepDataShowArticle would be the sqldatasource.
I am not very good at coding and if you can help me please provide a full sample. I appreciate the effort but sending me to yet another link will not help me very much. Thank you in advance.
The following is as far as I have gotten but I need help. I am not even sure if this is correct.
Protected Sub StepDataShowArticle_Select
End Sub
StepDataShowArticle would be the sqldatasource.
I am not very good at coding and if you can help me please provide a full sample. I appreciate the effort but sending me to yet another link will not help me very much. Thank you in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Would I do something like this? I'm really not sure of the syntax.
Protected Sub StepDataShowArticle_Select ing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls. SqlDataSou rceSelecti ngEventArg s) Handles StepDataShowArticle.Select ing
If StepDataShowSArticle.Count == 0
newsarticles.visible = False
Else news articles.visible = True
End If
End Sub
Protected Sub StepDataShowArticle_Select
If StepDataShowSArticle.Count
newsarticles.visible = False
Else news articles.visible = True
End If
End Sub
What is your code in aspx page?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER