Category : asp.net-mvc

I have code below. From that code, I need to remove the css class on a particular div <div class="testclass"> @{ IEnumerable<DisplayForm> assignment = val.Items.OrderBy(p => p.SortOrder ?? int.MaxValue); int displayIndex = 0; } <div class="ls-propval-list"> @foreach (DisplayFormItem displayItem in assignment) { if (displayIndex == 0) { if (displayItem.GetDisplayText(Model.ItemDisplayValue) == val.ItemDisplayName) { <div class="removeCSSClass"> @displayItem.Render(Model.Value, ..

Read more

how to send a parameter(parameter called kanwil) to controller in ajax? i try something like this to get value from the controller, but it doesn’t work function getBranchWil() { $.ajax({ type: "GET", url: ‘@Url.Content("~/CreateAccount/getBranchWil")’, data: "{kanwil : ’02’}", success: function (data) { var s = ‘<option value="-1">— Wilayah —</option>’; for (var i = 0; i ..

Read more

I have a set of KPI data I need to pass over to a Javascript file from my ASP.NET project. I thought I could do so using a ViewBag… Here is what is in the controller: public ActionResult KPI() { if (Session["OrganizationID"] == null) { return RedirectToAction("Unauthorized", "Home"); } else { int orgId; int.TryParse(Session["OrganizationID"].ToString(), out ..

Read more

Im trying to add data to a JSON object, stored in session. I do this with a js function: <section class="products"> @foreach (var prod in Model) { string path = "~/images/" + prod.ImgURL; <article> <a href="@Url.Action("InspectProduct","Products", new {productID = prod.Id})"> <img src="@Url.Content(path)" style="max-width: 75%"></a> <h3><a href="@Url.Action("InspectProduct","Products")">@prod.Name</a></h3> <h4>@prod.Price,-</h4> <a class="btn-add" style="cursor: pointer;" onclick="addToJSONObject(@prod.Id, @prod.Name, @prod.Price, @prod.Info)">Tilføj ..

Read more

$(‘#FL’).chosen(); function Action(code) { //alert(code); $.ajax({ type: "GET", url: "/ThirdLevel/ShowData?message=" + code, data: "{}", success: function (data) { var s = ‘<option value="-1">Select First Level</option>’; for (var i = 0; i < data.length; i++) { s += ‘<option value="’ + data[i].AccountNo + ‘">’ + data[i].AccountTitle + ‘</option>’; } $(‘#FL’).html(s); } }); $("#FL").trigger("chosen:updated") }; I want ..

Read more

Below is code of javascript. I want my checkboxes are selected based on coma seperated values from database. please let me know where i am mistaken function GetStatesList() { debugger; var makeList = []; var url = ‘/IAAISettings/GetStatesList’; $.ajax({ type: ‘POST’, url: url, success: function(stateList) { var makeChkList = “” for (var i = 0; ..

Read more

Need help with this, i’m super stuck: I dedided to use a jquery datatable but i was not able to create the EDIT button, i need to convert this: <td> @Html.ActionLink("EDIT", "Edit", new { id = item.code }) </td> Need help modifying my code, somebody? This is my CODE: @model IEnumerable<WebApplication.Models.Approval> @{ ViewData["Title"] = "Approvals"; ..

Read more

I’ve tried to copy the example for jQuery UI with my code, however the autocomplete isn’t showing currently. The example is from here: https://jqueryui.com/autocomplete/#custom-data <input id="FeatureSearch" tabindex="1" class="form-control" @*id="child-name"*@ placeholder="" required="" aria-required="true" type="text" style="width:420px;float:right"><br /> @*<input id="autoComplete" tabindex="1">*@ <!– Default "id" value = "autoComplete"> –> <input type="hidden" id="search-id"> <p id="parent-name"></p> <input type="hidden" id="parent-id"> $(function () ..

Read more