P
Patrick Olurotimi Ige
If have i a funtion below:-
Protected Function CheckUnit(Units As Object) As String
'-----------------------------------------
' If the Units returned equals to Zero,
' a message of "Out of Units" will be displayed.
' Otherwise, displayed the original value
'-----------------------------------------
If Integer.Parse(Units) = 0 Then
Return "Out Of Units"
Else
Return Units.ToString()
End If
End Function
I use :- <%# CheckUnit(Container.DataItem("Units")) %>
to display the value of the function.
But in C sharp it gives error so i used
<%# DataBinder.Eval(Container.DataItem, "Units") %>
and it works!!
whats the right code when using C# to dislpay the value using
<%# DataBinder.Eval(Container.DataItem, "Units") %>
with the CheckUnit Function???
Protected Function CheckUnit(Units As Object) As String
'-----------------------------------------
' If the Units returned equals to Zero,
' a message of "Out of Units" will be displayed.
' Otherwise, displayed the original value
'-----------------------------------------
If Integer.Parse(Units) = 0 Then
Return "Out Of Units"
Else
Return Units.ToString()
End If
End Function
I use :- <%# CheckUnit(Container.DataItem("Units")) %>
to display the value of the function.
But in C sharp it gives error so i used
<%# DataBinder.Eval(Container.DataItem, "Units") %>
and it works!!
whats the right code when using C# to dislpay the value using
<%# DataBinder.Eval(Container.DataItem, "Units") %>
with the CheckUnit Function???