Link to home
Start Free TrialLog in
Avatar of Steven Wells
Steven WellsFlag for Australia

asked on

apply formatting and styles to MVC view (migration from gridview)

hi,
I am teaching myself a bit of MVC web design. I have a asp.net VB site that I want to try and convert some features to MVC.

I have got my data in a vbhtml page showing, but I need to apply some rules

ie,

convert

   @Html.DisplayFor(Function(modelItem) item.FLT_INCIDENT )

to say something like, if item.FLT_INCIDENT value is 2, then display the word Request.

I used to use

  If e.Row.Cells(2).Text = "2" Then
                e.Row.Cells(2).Text = "Request"
                RequestImage.Visible = True
            Else
                e.Row.Cells(2).Text = "Incident"
                IncidentImage.Visible = True

            End If

Open in new window


when it was in a Grid View.

I don't understand if I should use a helper function or not.
ASKER CERTIFIED SOLUTION
Avatar of Ioannis Paraskevopoulos
Ioannis Paraskevopoulos
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Steven Wells

ASKER

Cool. Thanks