- public ActionResult chartofaccountscreate()
- {
-
- treeviewlist();
- return View();
- }
-
- [HttpPost]
- public ActionResult chartofaccountspost(FormCollection col)
- {
- chartofaccount coa = new chartofaccount();
- UpdateModel(coa);
- treeviewlist();
- if (ModelState.IsValid)
- {
- mse.chartofaccounts.Add(coa);
- mse.SaveChanges();
- }
- return View("chartofaccountscreate");
- }
-
- public void treeviewlist()
- {
- List<chartofaccount> all = new List<chartofaccount>();
- using (mastersEntities dc = new mastersEntities())
- {
- all = dc.chartofaccounts.OrderBy(a => a.AccountName).ToList();
- }
- ViewBag.accountname = all;
- }
- public ActionResult chartofaccountedit(String name)
- {
- treeviewlist();
- chartofaccount data=null;
- if (name == null) {
-
-
- return View("chartofaccountscreate");
- }
- else
- {
-
- data = mse.chartofaccounts.SingleOrDefault(x => x.AccountName == name);
- int aid=data.ID;
-
- return View("chartofaccountscreate", data);
- }
-
- }
- <input type="input" class="form-control" id="input-select-node" placeholder="Identify node..." value="Parent 1" style="margin-left:50px">
- <script>
- $(function () {
- $("#edit").click("change", (function () {
- search = $('#input-select-node').val();
-
- $.ajax({
- type: 'GET',
- url: '/chartofaccounts/chartofaccountedit{id}',
- contentType: "application/json; charset=utf-8",
- data: { name: search},
- cache: false,
- success: function (data) {
-
- alert(success);
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- alert("data not found" + textStatus + errorThrown);
- }
- });
- }));
- });
- </script>
am returning the selected node data to the view when i return the data controller to view it shows the error that data not foud i have the data