Monthly Archives: April 2013

Difference Between ViewResult() and ActionResult()

ActionResult -is an abstract class that can have several subtypes: ViewResult – Renders a specifed view to the response stream ActionResult is an abstract class that can have several subtypes. ActionResult Subtypes ViewResult – Renders a specifed view to the response … Continue reading

Posted in MVC | Tagged | Leave a comment

INTERVIEW QUESTION

INTERVIEW QUESTION Name a few different return types of a controller action method? The following are just a few return types of a controller action method. In general an action method can return an instance of a any class that … Continue reading

Posted in C#.NET, MVC | Tagged , | Leave a comment

How to extract 7z file to a folder C# .net

This article will show you how to extract .7z, .zip, .rar file using 7z.exe in C#.net. Here we add the code to control the 7-Zip executable. In the first part of the code, we specify the source file name and … Continue reading

Posted in C#.NET, MVC | Tagged , | Leave a comment

Multiple file-extensions searchPattern for System.IO.Directory.GetFiles

This article will show you to get multiple file-extension search pattern, in regular way you can get files with specific extensions but using same how to get Multiple file-extension, basically we are querying on the list file and get only … Continue reading

Posted in C#.NET, MVC | Tagged | 1 Comment

Inline Editing With the WebGrid in ASP.NET MVC 4

This article will show you how to create editable webgrid which will provide you a facility of inline editing using jQuery. Approach: Create an editable grid for user table. The key to this approach is to populate the grid with … Continue reading

Posted in ASP.NET MVC Web Grid, css, jQuery, MVC | Tagged , , , | 2 Comments

How to get the client IP address for the current controller call.

This article will show you hoe to get client IP address for the current controller Note: you have to add using System.ServiceModel.Channels; namespace. Add a reference to the assembly System.ServiceModel. Select Project-> Add Reference and then select the assembly name … Continue reading

Posted in C#.NET, MVC | Tagged , | Leave a comment

How to access session in web api controller in mvc4

I realize session and REST don’t exactly go hand in hand but it is not possible to access session state using the new Web API. HttpContext.Current.Session is always null. REST is stateless. If you use a session the processing will … Continue reading

Posted in C#.NET, MVC | Tagged , | 1 Comment