Skip to main content

Posts

Showing posts with the label asp.net-mvc

How to format a JSON date?

I'm taking my first crack at Ajax with jQuery. I'm getting my data onto my page, but I'm having some trouble with the JSON data that is returned for Date data types. Basically, I'm getting a string back that looks like this:

ASP.NET MVC and AJAX

I have a view which is composed of top, left and bottom headers and a main contents pane. Suppose that during an AJAX request I need to update the HTML of the top, bottom and main panels (the left header should stay the same). I was wondering what would be the best way to accomplish this. The first thought was to put the main contents panel into a partial and have a controller action that would return PartialView. This wouldn't work because as the action returns only the HTML of the main pane I cannot update the top and bottom headers. So if I put the top and bottom headers into their own respective partial views I would need my controller action to return multiple partial views. Is this possible at all or I am doing something completely off the track? I saw that it is possible to render a partial view to a string so I thought that I could use this technique in the action to return a JSON object with 3 properties representing the HTML of the 3 partials that I need to updat

How to enable navigation buttons of jQuery grid in mvc3 and assign buttons to specific links?

I have read some topic regarding with my question but there code doesn't work for me. Honestly, I'm not good in jQuery. I have this working views and controller, but it has a lot disadvantages that is why I switch to using jQuery grid. Working code (not using jQuery grid): @using Custom.Helpers @model IEnumerable<Models.DeviceMVC> @{ ViewBag.Title = "List"; } <div id="page-title"> <h2>Device list</h2> <div id="Optiontab"> @Html.ActionLink("Create New", "Create") </div> </div> <table id="table-list"> <tr> <th> Branch </th> <th> Name </th> <th> Login id </th> <th> Serial number </th> <th> Brand </th> <th> Model