Advertisement
Guest User

Untitled

a guest
Aug 12th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. <script>
  2. $(document).ready(function ()
  3. {
  4. $('#urunsec').change(function () {
  5. var id=$('#urunsec').value();
  6. $ajax({
  7. url:'Fatura/UrunList',
  8. type:'POST',
  9. data: { id: id },
  10. success: function () {
  11. alert('suc');
  12. },
  13. error: function (error) {
  14. alert('error')
  15. }
  16.  
  17. })
  18. });
  19. });
  20.  
  21. @foreach (BillApplication.Models.Urunler con in Model )
  22. {
  23. <tr>
  24. <td>
  25. <input id="urunsec" type="checkbox" name="urunsec" value="@con.UrunId.ToString()" />
  26. <input name="urunsec" type="hidden" value="false" />
  27. </td>
  28. <td>@con.UrunId</td>
  29. <td>@con.UrunAdi</td>
  30. <td>@con.UrunFiyat</td>
  31. <td>@con.AltkategoriId</td>
  32. <td colspan="4"></td>
  33. </tr>
  34.  
  35. }
  36. <tr>
  37. <td>
  38. <input id="Button1" type="button" value="button" onclick="location.href = '@Url.Action("Create", new { idlist= @ViewBag.abc as List<String>})'" />
  39.  
  40. </td>
  41. </tr>
  42.  
  43. [HttpPost]
  44. public ActionResult UrunList(string id)
  45. {
  46. this.UrunList(id);
  47. List<String> idlist = new List<String>();
  48. idlist.Add(id);
  49. ViewBag.abc= idlist;
  50. return RedirectToAction("Create");
  51. }
  52.  
  53. <td><textarea id="txt_urunler" rows="2" cols="20" style="border-style:inset; width:150px; border-width:0.2em; border-color:gainsboro">
  54.  
  55. @if (@ViewBag.abc != null)
  56. {
  57. foreach (var i in ViewBag.abc)
  58. {
  59. @i
  60. }
  61. }
  62. </textarea>
  63. </td>
  64.  
  65. public ActionResult Create(List<String> idlist)
  66. {
  67. string virgul = ",";
  68. ViewBag.virgul = virgul;
  69.  
  70. if (idlist != null)
  71. {
  72. ViewBag.abc = idlist;
  73. }
  74. return View();
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement