The Webgrid helper This series of documents outlines basic usage of the webgrid helper, and how to implement paging, sorting and selection comparable to the Webforms GridView control. You can download the final iteration of the solution file here: MVC-Sample-PagingSorting.zip Basic usage The controller class below retrieves the products table from the NorthWind demo database, […]
Author: bobnoordam
MVC File upload
The view part Our view defines a multipart form to enable us to post both files and other model/form fields. Once a file is uploaded the controller will set the ViewBag.UploadStatus to a confirmation message, causing the upload part to disappear and the confirmation to appear. The multipart declaration in the form is required to […]
How to enable Windows installer logging
Windows installer has a logging service which can give a lot of detail about what is going on “under the hood” when an installation fails. To enable the logging function, create the following registry path and keys: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer Reg_SZ: Logging The value of the field defines the different logging mode’s. You can place multiple letters […]
Scaffolding for an ASPxGridView with Select button using custom callbacks
Emulates the behaviour of the standard webforms grid, with a view where each line has a button that can be used to ‘select’ that line. This should make transition from the built in gridview to de ASPxGridView very easy. The click is processed server side It is not possible to select more then one line […]
Effective VHDX compacting with HYPER-V 2012 and networked storage
There are a lot of instructions out on the internet which lead you through some compacting routine, with varying success. This usually amounts to stopping the VM/VDI and running the disk edit function from the HYPER-V console. In many cases, and especially if you are using networked storage, you will find that most of the […]
Copying files while retaining permissions
Now here is one very basic system administration issue that pops up from time to time and still seems to create a lot of confusion “in the field”. When copying files from one location to another there are some cases where permissions are automatically retained, and some where you have to take special precaution. Here […]
Page and control level validation using javascript with asp.net
This sample is a complete minimal implementation of client side verification of inputs before a pass to the server is made. Verification is done on control level with the onblur() event, and on page level when the form is submitted. This validation is faster then round-tripping to the server for each event, especialy with large […]
NUGET not available as a package source after VS update
After installing or updating to Visual Studio 2015, you may only have “Microsoft and .NET” as package source in the nuget package manager. To re-add the nu-get repository go to Tools/Options/NuGet Package/Manager and re-add the following under “Package Sources”: Name: nuget.org Source: https://api.nuget.org/v3/index.json
Sql Server sorting with a partial numeric field
Recently i came accross a database that stored customer numbers in a NVARCHAR field and wanted to sort on this value. By default this will not give you the order you want, since you will get a sort order like: 1 10 11 2 20 etc. This can be easily overcome with the CONVERT statement. […]
MVC – Making a popup editor element in asp.net mvc
This document demonstrates a way to present the viewer with a list of records, and use a popup window to edit the data. This is acomplished in MVC by using a viewmodel that contains the record list – and at the same time provides the data fields of an optional selected record. The popup by […]