Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.16 KB | None | 0 0
  1. <style type="text/css">
  2.     div.growlUI {
  3.         background: no-repeat 10px 10px;
  4.     }
  5.  
  6.         div.growlUI h1, div.growlUI h2 {
  7.             color: white;
  8.             padding: 5px 5px 5px 75px;
  9.             text-align: left;
  10.         }
  11. </style>
  12. @using WEB
  13. @{
  14.     var alerts = TempData.ContainsKey(Alert.TempDataKey)
  15.                 ? (List<Alert>)TempData[Alert.TempDataKey]
  16.                 : new List<Alert>();
  17.  
  18.     foreach (var alert in alerts)
  19.     {
  20.    
  21.     <script type="text/javascript">
  22.         $(function () {
  23.             @{
  24.         if (alert.AlertStyle == AlertStyles.Success)
  25.         {
  26.                     <text>
  27.             $.growl.notice({ message: "@alert.Message" });
  28.                     </text>
  29.         }
  30.  
  31.         if (alert.AlertStyle == AlertStyles.Error)
  32.         {
  33.                     <text>
  34.             $.growl.error({ message: "@alert.Message" });
  35.                     </text>
  36.         }
  37.  
  38.         if (alert.AlertStyle == AlertStyles.Information)
  39.         {
  40.                     <text>
  41.             $.growl.warning({ message: "@alert.Message" });
  42.             </text>
  43.         }
  44.             }
  45.         })
  46.     </script>
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement