页面中,绑定后台方法

aspx:

   在repater中,

      <%#_TextType(CInt(Eval("FavoriteType")))%>      //显示的文本

    

 VB:

   Public Function _TextType(ByVal FavoriteType As Integer) As String
        Dim t As String
        If FavoriteType = 0 Then                      
            t = ""                                                  

        ElseIf FavoriteType = 1 Then
            t = ""
        Else
            t = ""
        End If
        Return t
    End Function

   t里面 可以在绑定的每一行前面,加上标识,比如:1 2 3,出租,出售,类型之类的,

  也可以添加到 A 标签中,跳转不同的连接

  <a href="<%#_Type( CInt(Eval("FavoriteType")),CInt(Eval("SourceID")) )%>"> 为每一行,根据类型,判断不同的链接

   根据自己的需要,写不同的方法进行绑定

 

原文地址:https://www.cnblogs.com/lice/p/1915739.html