MVC

ng-grid search sort paging with AngularJs WebAPI and MVC ASP.Net

We are going to use ng-grid with feature like searching, sorting and paging of records, we will use paginated data, means pull only as many records as we have to show into our ng-grid. We already discussed about the AngularJS application structure in our previous article see [ASP.Net MVC Web API AngularJS and Bootstrap application structure][3]. We will use Entity Framework and WebAPI to search... By Ali Adravi   On 30 Nov 2014  Viewed: 22,778
  • ng-grid
  • angularjs
  • webapi
  • mvc

ASP.Net MVC Web API AngularJS and Bootstrap application structure

Application structure by using ASP.Net MVC, Web API, AngularJs is not complicated but we need to know what NuGet Packages are required and what can make the application easy and speed up the development. In this article we will use MVC 4, Visual Studio 2012, Web API and AngularJS to create a single page application. We will try to use different folders for keeping our controllers, services,... By Ali Adravi   On 17 Nov 2014  Viewed: 9,668
  • angularjs
  • webapi
  • mvc
  • bootstrap
  • asp.net

ViewData, ViewBag, TempData and Session in MVC

ViewBag, ViewData, TempData and Session are the options to send value from controller to view or to other action method/pages. ViewData and ViewBag are very straight forward, they used to send the data from controller to view and done but in case of TempData and Session we can pass values from controller to view and even we can get our value from other pages after redirecting. As we know TempData... By Ali Adravi   On 15 Nov 2014  Viewed: 4,627
  • mvc
  • asp.net

MVC WebGrid Search code with example

MVC webgrid searh page with pagination: There are many benefits of using WebGrid in place of table like paging, sorting and alternate row style etc., in our previous article we see [MVC search page example with code][1] but there we used table to create the structure of gridview which is missing sorting and alternate row functionality. In this article we will use WebGrid and check how easy it is... By Ali Adravi   On 25 Aug 2013  Viewed: 17,867
  • webgrid
  • mvc

mvc search page example with code

MVC Searh page with pagination: It’s very easy to create a search page in asp.net but when I try to create the same in MVC I faced many problems, how to create model, how to keep searched values in search controls, pagination, I found myself nowhere, so start searching for some good examples but whatever I found was not quite helpful so try my own. I will explain the same in this... By Ali Adravi   On 25 Aug 2013  Viewed: 35,899
  • mvc
  • search
  • model

MVC insert update delete and select records

CRUD (Create, Retrieve, Update and Delete) in MVC. When we start to learn new language, first we try to run an application with “Hello World” and then CRUD functionality. So in this article we will see how to select records from database (with WebGrid, pagination and sort functionality), update a record, add new record and finally delete a record in ASP.Net MVC. Let’s create a simple table... By Ali Adravi   On 17 Aug 2013  Viewed: 99,103
  • mvc
  • asp.net
  • sql server

ActionResult VS ViewResult in MVC

In MVC controls there are different type of action result we use as a return type from a controller action method in which ViewResult, ActionResult and JsonResult are commonly used. In this article we will learn what are the available action results and which one we need to use in which case. The ActionResult class is the base class for action results, following types derive from... By Ali Adravi   On 19 Jul 2013  Viewed: 3,441
  • actionresult
  • viewresult
  • mvc

Action filter basics in ASP.Net MVC

Action filter in MVC is from very first version. Sometimes we want to perform logic before or after calling the action method, to support this MVC provides action filters. Action filters are used as attributes. Filter can be applied on action method or directly to the controller. Suppose we want an action method (say Edit) to be viewed only by authorized users then [Authorize] ... By Hamden   On 13 Jul 2013  Viewed: 1,240
  • action-filter
  • mvc

How to create a single thanks page for entire controller in MVC

Sometimes we need a thanks page say we have user registration, change password, activate account functionality in our application then we need a thanks page after registering with our site, to say thanks for registering with us or showing confirmation that your password is successfully changed or your account is successfully activated. So do you think we need three different view for these... By Hamden   On 30 Jun 2013  Viewed: 3,191
  • mvc
  • dynamic-view

MVC jquery autocomplete with value and text field

In MVC, autocomplete with jquery is the best way to pull data from database and render according to our requirements, so in this article we will use jquery to show the auto complete text box without any ajax controls. We need a method to get the data from database, a controller method to handle the action and a jquery/javascript function to call the controller method. Note: we will use... By Ali Adravi   On 29 Jun 2013  Viewed: 6,220
  • mvc
  • jquery
  • json
  • auto-complete

Upload files with model data in MVC

Upload multiple files with model data in MVC is really very easy, when I started to test by uploading some files, I though it would be more complicated but it is really not. In my previous post [ASP.Net MVC file upload][1], I promised to post soon about how to upload multiple files. When I was writing I thought why cannot add model data as well at the time of uploading the files. We will... By Ali Adravi   On 04 Jun 2013  Viewed: 23,042
  • mvc
  • file-upload

ASP.Net MVC file upload

How to upload file or image in asp.net mvc is not difficult but is totally different compare to asp.net FileUpload control. If we are asp.net developer and we are new to mvc then we immediately noticed we don’t have server side controls so the FileUpload control as well and our problem start here. Now we start searching how to upload a file if there is no FileUpload control, no problem whatever... By Ali Adravi   On 25 May 2013  Viewed: 7,451
  • mvc
  • asp.net
  • file-upload

Add calendar to textbox in MVC in 2 minute

Adding calendar with a text box for new MVC developer is not so easy, I always found in my team people struggle to add a calendar with a text box, while it is as easy as jut to add one line of code and done. It’s true, when first time I try to add a calendar with a text box I also searched many website, read blogs and found, I need to add many jquery files from different locations before using... By Ali Adravi   On 03 Feb 2013  Viewed: 6,294
  • mvc

Add facebook twitter and google plus in C# MVC application

You need to share your website content with faceboo, twitter and google+ to increase traffic of your website. it's quite easy to implement. You need just a helper class and one line code in your page to call that helper class and done. so let's first write the helper class public static class SocialNetworkingHelper { #region[Twitter helper Method] private... By Ali Adravi   On 13 Jan 2013  Viewed: 3,396
  • mvc
  • c#

MVC model validation for email from database in asp.net

There are many cases where we need to validate the value in controls before submitting to the database, so let's discuss email validation like format, length and existence into database. We will walk through in this article, how to validate entered user email from database, whether email is already exists in database if yes then show error to user that email already taken by some one, if no email... By Ali Adravi   On 05 Jan 2013  Viewed: 6,038
  • mvc
  • asp.net

MVC paging with linq to sql and html helper class

To use paging in MVC you need to first create structure to pass values form page to HTML Helper class so first create a class to keep and pass the page information public class PagingInfo { public int TotalItems { get; set; } public int ItemsPerPage { get; set; } public int CurrentPage { get; set; } public int TotalPages { ... By Ali Adravi   On 03 Jan 2013  Viewed: 3,094
  • mvc
  • linq to sql
12