Category Archive: C# and .NET

Mar 28

Yet another custom binary protocol library implementation

Recently I have been involved in a project that required a custom binary protocol specification be written for interaction between some custom hardware and a central processing server. Before you wonder why re-invent the wheel I did look into protoBuf but although perfect for what I was doing, implementing this on the custom hardware would …

Continue reading »

Feb 10

Calling .NET MVC 3 action method via jQuery ajax and handling serverside redirect

Recently I developed a .NET MVC 3 application where jQuery would be a core part of the design and it was accepted that we did not have to worry any special optimization for phone or mobile devices or disabling of javascript. During development of this application I wanted to make use of page redirects while …

Continue reading »

Oct 05

ViewModel composition and using Partial views with Partials

Slightly confused by the title of this topic? I can see why. Even I didn’t know what to give the name to the problem a recent problem I encountered and I ended up resolving it. Instead I’ll try and state the problem in my definition below: Please note. There might be better ways of doing …

Continue reading »

Jun 29

Calling Delphi 6 DLL from c#.NET and blasted rounding issues

Recently I had the need to call a Delphi DLL from a .NET application. The delphi DLL would be performing a number of floating point arithmetic operations and returning results in as a string. In order to debug the delphi DLL another delphi application was written that uses this same interface and outputs the results. …

Continue reading »

Showing Enums in a dropdownlist on our ASP.NET MVC view

A little while ago I posted a discussion on a method to decorate Enums with attributes to provide some flexibility with how they are displayed. Background This came about in a project I worked on where we wanted to show user friendly names of an enumeration on a Web UI page, but the same Enum …

Continue reading »

Mar 18

Posting content from memory stream using HttpWebRequest c#

So I needed to upload a zipped file that I was creating in memory and send it to an MVC action on my server. I read plenty of examples and perhaps I could have gone down the route of saving the stream to a file on disk and then using the .net WebClient UploadFile method. …

Continue reading »

Older posts «