2016-06-22 1 views
2

신호 R로 모든 알림을 받고 싶습니다. 데이터베이스에서 오는 모든 알림과 함께 드롭 다운 목록을 채우기를 원합니다 ... 모든 알림을 받았지만, 모든이 하나의 통지처럼 ..these 아래로 ... 모두 >>> == >>> === ... 적절한 형식jquery ajax로 드롭 다운을 작성 ASP.NET MVC

public ActionResult GetMessages() 
     { 
      MessagesRepository _messageRepository = new MessagesRepository(); 
      return PartialView("_MessagesList", _messageRepository.GetAllMessages()); 
     } 

보기 enter image description here

컨트롤러없는

function getAllMessages() 
       { 
        var tbl = $('#messagesTable'); 
        $.ajax({ 
         url: '/Home/GetMessages', 
         contentType: 'application/html ; charset:utf-8', 
         type: 'GET', 
         cache:'false', 
         dataType: 'html' 
        }).success(function (result) { 

         $.notiny({ 
          text: 'New Notification Available You May Check', 
          animation_hide: 'custom-hide-animation 0.5s forwards' 
         }); 

         tbl.empty().append(result); 


        }).error(function() { 

        }); 


       } 
+0

그래서 정확히'부분 수익을 _MessagesList' 무엇이

_message == >>처럼 ... <table> 태그에 코드를 작성해야 있나요? –

답변

1

있음 당신의 _Message는

<table> 
    @foreach (var item in Model) 
    { 
     <tr> 
      <td> 
       @Html.DisplayFor(modelItem => item.Message) 

       @Html.DisplayFor(modelItem => item.EmptyMessage) 

      </td> 
     </tr> 


    } 

</table>