Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(document).ready(function ()
- {
- $('#urunsec').change(function () {
- var id=$('#urunsec').value();
- $ajax({
- url:'Fatura/UrunList',
- type:'POST',
- data: { id: id },
- success: function () {
- alert('suc');
- },
- error: function (error) {
- alert('error')
- }
- })
- });
- });
- @foreach (BillApplication.Models.Urunler con in Model )
- {
- <tr>
- <td>
- <input id="urunsec" type="checkbox" name="urunsec" value="@con.UrunId.ToString()" />
- <input name="urunsec" type="hidden" value="false" />
- </td>
- <td>@con.UrunId</td>
- <td>@con.UrunAdi</td>
- <td>@con.UrunFiyat</td>
- <td>@con.AltkategoriId</td>
- <td colspan="4"></td>
- </tr>
- }
- <tr>
- <td>
- <input id="Button1" type="button" value="button" onclick="location.href = '@Url.Action("Create", new { idlist= @ViewBag.abc as List<String>})'" />
- </td>
- </tr>
- [HttpPost]
- public ActionResult UrunList(string id)
- {
- this.UrunList(id);
- List<String> idlist = new List<String>();
- idlist.Add(id);
- ViewBag.abc= idlist;
- return RedirectToAction("Create");
- }
- <td><textarea id="txt_urunler" rows="2" cols="20" style="border-style:inset; width:150px; border-width:0.2em; border-color:gainsboro">
- @if (@ViewBag.abc != null)
- {
- foreach (var i in ViewBag.abc)
- {
- @i
- }
- }
- </textarea>
- </td>
- public ActionResult Create(List<String> idlist)
- {
- string virgul = ",";
- ViewBag.virgul = virgul;
- if (idlist != null)
- {
- ViewBag.abc = idlist;
- }
- return View();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement