title: Toast with foreach loop
body: <p>I hope that somebody know how to solve my problem.
  So, I have installed Toastr to show notifications in my ASP.NET MVC application.
  And what I have is the view with table and foreach loop for every element passed from controller:</p>
  
  <pre><code>@foreach (var item in Model)
      {
          &lt;tr&gt;
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.CategoryName)
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.StartDate)
              &lt;/td&gt;
              &lt;td&gt;
                 @{
                      Html.RenderAction("_CourseQuantityCount", "Course", new { item.CourseID });
                  }
                  /@Html.DisplayFor(modelItem =&gt; item.MaximumQuantity)
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.Price)
              &lt;/td&gt;
              &lt;td id="alert"&gt;
                  @Html.ActionLink("SignIn", "SignIntoCourse", new { item.CourseID }, new { id = "myLink" })
              &lt;/td&gt;
          &lt;/tr&gt;
                      }
  &lt;/table&gt;
  </code></pre>
  
  <p>After the view there is a script section which look like this:</p>
  
  <pre><code>@section scripts {  
  
  &lt;script type="text/javascript"&gt;
          $(document).ready(function () {
              toastr.options = {
                  "closeButton": false,
                  "debug": false,
                  "newestOnTop": false,
                  "progressBar": false,
                  "positionClass": "toast-top-center",
                  "preventDuplicates": false,
                  "onclick": null,
                  "showDuration": "300",
                  "hideDuration": "1000",
                  "timeOut": "5000",
                  "extendedTimeOut": "1000",
                  "showEasing": "swing",
                  "hideEasing": "linear",
                  "showMethod": "fadeIn",
                  "hideMethod": "fadeOut"
  
              };
              $('#alert').click(function () {
                  toastr.warning('Already signed!')
              });
          });
  
          $('#myLink').click(function (e) {
  
              e.preventDefault();
              $.ajax({
                  url: $(this).attr("href"),
              });
  
          });
          &lt;/script&gt;
  }
  </code></pre>
  
  <p>And finally if I load my app it works good, but only for the first element from foreach loop. The aim is that if a user is signed into a course he received a toast that he is signed already. I think that the problem can be the same id within all foreach loop, but I am not sure. And I don't know how to create multiple ids and then use it in JS scripts in a way without refreshing a page, but only receiving toast.</p>