P
Phillip Vong
I'm using VS2005 and creating a simple test ASPX page in VB.
I have a simple FORMVIEW1 with a label "YTDLabel" databound to a SQL DB.
The DB datatype is set to decimal (18,2) and the value of this cell is 16.1.
Here is my simple Page_Load code and all I want it to do is see if the
decimal figure is greater than 1, if it is, then hide the YTDLabel. The
error message I'm getting from VS2005 is that
FormView1.FindControl("YTDLabel") is underlined and it says "Value fo Type
'System.Web.UI.Control' can not be converted to 'Decimal'". Can someone
help me out? I'm just a newbie trying to learn. Thanks!
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim YTDtest As Decimal
YTDtest = FormView1.FindControl("YTDLabel")
If YTDtest > 0 Then
FormView1.FindControl("YTDLabel").Visible = False
End If
End Sub
I have a simple FORMVIEW1 with a label "YTDLabel" databound to a SQL DB.
The DB datatype is set to decimal (18,2) and the value of this cell is 16.1.
Here is my simple Page_Load code and all I want it to do is see if the
decimal figure is greater than 1, if it is, then hide the YTDLabel. The
error message I'm getting from VS2005 is that
FormView1.FindControl("YTDLabel") is underlined and it says "Value fo Type
'System.Web.UI.Control' can not be converted to 'Decimal'". Can someone
help me out? I'm just a newbie trying to learn. Thanks!
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim YTDtest As Decimal
YTDtest = FormView1.FindControl("YTDLabel")
If YTDtest > 0 Then
FormView1.FindControl("YTDLabel").Visible = False
End If
End Sub