<% if Eval("value") = 0 then%> it's possible?

Last post 05-16-2008 6:30 PM by Ceffie. 3 replies.

Sort Posts:

  • <% if Eval("value") = 0 then%> it's possible?

    08-20-2006, 5:28 PM
    • Loading...
    • aooa.de
    • Joined on 08-20-2006, 9:19 PM
    • Posts 2

    Hi all,

    it is possible to make a if else end if question into a formview or repeater?

    <asp:formview...
      <itemtemp...
        <% if Eval("value") = 0 then%>
          link1
        <%else%>
          link2
        <%end if%>
    ....

  • Re: <% if Eval("value") = 0 then%> it's possible?

    08-20-2006, 6:36 PM

    I'd pass it to a function instead.

    <%# DoSomething(Eval("value")) %>

    Public Function DoSomething(ByVal value As Integer) As String
       If value = 0 Then
          Return "blah"
       Else
          Return "blah blah"
       End If
    End Function

    Ryan

    Ryan Olshan
    ASPInsider | Microsoft MVP, ASP.NET
    http://ryanolshan.com

    How to ask a question
  • Re: <% if Eval("value") = "other_value" then%> it's possible?

    04-02-2008, 10:32 AM
    • Loading...
    • ameenm99
    • Joined on 03-28-2008, 7:23 AM
    • Posts 5
    Manager Type From To Hours Status
    here status having the values Approved ,Applied, Credited by admin and Cancelled Applied is default in status field ' Runat="server">Modify ' Runat="server">Cancel
    In brief….. It s the page to display the leave request of employees to the corresponding manager When emp requests ,,,,the status comes as “applied” by default……….. And the corresponding manager response against request by updating status field as Approved or Rejected And if emp want to modify his leave request….. he clicks hyper link “Modify” and for cancellation clicks “Cancel” So… I have two hyper links named cancel and modify………… If the status field comes as Rejected I don’t want to display the two hyperlinks modify n cancel If it comes as approved…then I don’t want modify link………… I think u got the point well………. help me about the point……….???
  • Re: <% if Eval("value") = 0 then%> it's possible?

    05-16-2008, 6:30 PM
    • Loading...
    • Ceffie
    • Joined on 04-10-2008, 10:01 AM
    • Posts 20

     ok, took your example and tryed this:

    ForeColor='<%#testforsold(Eval("stock")) %>'

    and :

    Public Function testforsold(ByVal stock As String) As String
            If stock = "Sold" Then
                Return "#f03439"
            Else
                Return "#FF0000"
            End If
        End Function

    i get an error saying cant convert to system.drawing.color

    i almost wanna say change the As sting to as system.drawing.color

    but not sure.

     

Page 1 of 1 (4 items)