Am having a Form View with a customised template. I also added a Label with ID as "StatusLabel".
I want to target the text of the Label and change the color depending on the text.
If i have text as good, then color will be green, bad - red.
Pls how do i go about this bacause i cant find the control in the form from codeview..
You use something like formview1.FindControl("Label1") and cast that to Label. You can then manipulate the label any way you see fit.
Get it in FormView DataBound event.
Dim StatusLabel as Label = DirectCast(FormView1.FindControl("StatusLabel"), Label)
Thanks bro, i was targeting the wrong event with the same code
沒有留言:
張貼留言