How to POST an array of objects with $.ajax

Base on earlier post which I talk about JSON. Here is the application part. Imagine you have an array of objects from client side need post back to server side for processing. JSON.stringify can do the trick of sending the array back to server side. Remember to put it before sending it.    

Binding Bootstrap Dual ListBox with ASP.NET MVC

I have use duallist box from http://www.virtuosoft.eu/code/bootstrap-duallistbox/  to populate list of staff entity from controller that come back from a json request. To load unselected and selected staff at the same time and display the unselected staff on the left side of dual listbox while selected one on right side. In html: In content:  <%: Styles.Render( <%: …

Continue reading Binding Bootstrap Dual ListBox with ASP.NET MVC

Making a Simple Ajax call to controller in asp.net mvc to load data into dropdownlist

Controller: Public Function Get_Plant() As ActionResult Dim plantrole As New PlantRequestParam Dim rinfo = New Common.ResultInfo rinfo = iPlant.GetAllActiveList(plantrole) Return Json(rinfo) End Function View: var AjaxUrl = "../Home/Get_Plant"; $.ajax({ type: 'POST', url: AjaxUrl, contentType: 'application/json; charset=utf-8', success: function (data) { if (data.Status == true) { var taglist = data.Data; $.each(taglist, function (index, value) { var …

Continue reading Making a Simple Ajax call to controller in asp.net mvc to load data into dropdownlist

Authorization failure for Ajax request in MVC application

I encounter an ajax request authorization failure and causes bad user experience. I had click on a button which require ajax response in my ASP.net MVC application which already timout. Below is the way to handle it properly without getting any bugs. I have created a OnAuthorizationModule action filter to check on each action to determine …

Continue reading Authorization failure for Ajax request in MVC application

Simple way of adding a row of textboxes dynamically for input

How to add a row of column dynamically when user click the link to add new row? Below illustration were done in MVC framework whereby as it is not as easy as using the control directly in web form. These concerns are populate data into the drop down list, passing back all newly added data …

Continue reading Simple way of adding a row of textboxes dynamically for input