All

MVC DropDownListFor fill on selection change of another dropdown

Binding DropDownListFor from enum, database and some hard coded values in our previous article [MVC dropdown binding best ways][1]. In this article we will try to bind child Dropdown on selection change of parent Dropdown, say Country to State or Sate to City, by using jQuery which will call an action in controller and return JSON for selected id, and with the help of jQuery append values to... By Ali Adravi   On 11 Apr 2015  Viewed: 168,387
  • mvc
  • dropdownlistfor
  • jquery
  • javascript

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: 105,856
  • mvc
  • asp.net
  • sql server

Angular 2 Search and Sort with ngFor repeater with example

In angular 2 we don't have pre-defined filter and order by as it was with AngularJs, we need to create it for our requirements. It is time killing but we need to do it, (see [No FilterPipe or OrderByPipe][1]). In this article we are going to see how we can create filter called pipe in angular 2 and sorting feature called Order By. Let's use a simple dummy json data array for it. Here is the json... By Ali Adravi   On 16 Apr 2017  Viewed: 83,488
  • angular-2
  • angularjs
  • pipe
  • filter

Search, sort, paging, insert, update and delete with ASP.Net MVC and bootstrap modal popup PART-1

Search, sort, paging, insert, update and delete with ASP.Net MVC and bootstrap modal popup and WebGrid to show records with search, sort and paging feature and in next article we will complete our article by adding insert, update and delete feature with bootstrap modal popup. We are going to use Entity Framework 6 code first model with a very simple table phone. Adding client side sorting and... By Ali Adravi   On 28 Dec 2014  Viewed: 60,342
  • mvc
  • bootstrap
  • webgrid
  • modal-popup
  • asp.net

Angularjs Cascading Dropdown/Select with demo

Cascading dropdown with angularjs is easier than MVC and ASP.Net. In Angularjs ng-change is the best event to hook the function to get the second dropdown list items. In this article, we will try to fill the state dropdown on selection change of country and then fill the city dropdown on change of state dropdown. We will fetch only those records from database which match the criteria rather... By Ali Adravi   On 06 Aug 2015  Viewed: 57,357
  • angularjs
  • select
  • dropdown
  • cascading

Angular 2 Dynamically Add & remove Components

Angular 2 gives full control to add or remove component in other component programmatically by simple steps. In this article we are going to see how to add, remove experience component to any other component, we will also try to pass some values to component from parent to child component to see if it is possible or not. It's better to write on plunker so we can test at anytime from... By Ali Adravi   On 27 Aug 2017  Viewed: 50,192
  • angular2
  • angularjs

Search, sort, paging, insert, update and delete with ASP.Net MVC and bootstrap modal popup PART-2

To add insert, update and delete feature we are going to use bootstrap modal popup with a single JavaScript method to open any partial view as a modal popup and one method to post the data from modal, which can work for entire application. First we will add some code to our layout view to dynamically add the partial view in it and JavaScript file, then we will add code only one for add new... By Ali Adravi   On 28 Dec 2014  Viewed: 49,252
  • mvc
  • bootstrap
  • modal-popup
  • asp.net

Angularjs Constant and enum with example

As we know the benefit of constant and enum in any other language, we need to it wherever need in our project. But angularjs does not have any enum concept, we will try to create some constants, object to achieve the same goal of enum easily with example. Luckily AngularJS provides a `constant` service type that can be used for static data that will not change and can be used throughout the... By Ali Adravi   On 02 Sep 2015  Viewed: 48,620
  • angularjs
  • constants
  • enum

Interface in C# with real time example

In this article we will discuss about interface in C# with real time example, it properties, implementations and pros and cons as well. 1. An interface can never be instantiated e.g. ICar car = new ICar(); It’s wrong. 2. It only contains signature of its methods. 3. An interface has neither constructor nor fields. 4. It is also not permitted to have access modifier on its methods. 5. Its... By Ali Adravi   On 18 Aug 2013  Viewed: 47,361
  • interface
  • c#
  • oops

MVC dropdown binding best ways

To Bind a DropDownListFor or DropDown in asp.net MVC from database, from enum or from hard coded values, most people suggest to add a property in the model with IEnumarable or IList. We can use it but not very helpful because after every postback we will need to fill the list again otherwise it will be null. So using ViewBag is not a bad idea, we will use it in our article. What we will see... By Ali Adravi   On 04 Apr 2015  Viewed: 47,105
  • dropdown
  • dropdownlist
  • dropdownlistfor
  • mvc
  • enum

Angularjs dropdown select value, text, multiple values with demo

Angularjs dropdown/slect have more option than any other .net language dropdownlist, we can bind and get only Id or Text or both from dropdown, even we can bind and get more than two values like value, text and role from a dropdown and even more. We can try to see all the possible ways to bind the dropdown/select in this article, which is not possible to cover every thing but we will try our best... By Ali Adravi   On 05 Sep 2015  Viewed: 46,484
  • angularjs
  • dropdown
  • select

IEnumerable and IEnumerator in C# with real time example

We will discuss here what is IEnumerable, IEnumerator, what are differences between them, where should we use IEnumerable and where to IEnumerator, once we will finish our discussion it will be clear, which one would be best for which situation and why, so let’s see it with example To better understand we will create a list of age List<int> ages = new List<int>(); ages.Add(10); ... By Ali Adravi   On 29 Mar 2013  Viewed: 44,548
  • oops
  • c#

Gridview multiple header rows

How to show multirow header in gridview in asp.net? i was searching for this question but could not found any easy way so I decided to try my own and found it is not so difficult. Simply we can use header template and item template and design it according to our requirements. we will see this in action in this article. First let's see what we are going to do, here is the final output which we... By Ali Adravi   On 30 May 2013  Viewed: 43,448
  • gridview
  • asp.net

Convert object to json and json to object in C#

In this article we will see how to convert an object to json string or how to convert a json string to an object in C#, we will try to write a generic class with two methods, one for converting an object to json and other for converting json string to an object. I searched internet to get if there is anything like this with .net but could not found any which we can use directly, so let's... By Ali Adravi   On 16 Jun 2013  Viewed: 41,158
  • json
  • c#
  • asp.net

Angular 4 upload files with data and web api by drag & drop

Upload file with data by clicking on button or by drag and drop, is the topic of this article. We will try to create an image gallery by uploading files and save data into database and images into a folder. We will try to create a component in a way that it can be used anywhere in entire application and configure properties like file size, type of files, single or multiple files, maximum number... By Ali Adravi   On 24 Sep 2017  Viewed: 40,945
  • angular2
  • angularjs
  • web-api

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: 40,041
  • mvc
  • search
  • model

Linq inner join, left outer join on two lists in C# with example

Joining two generic lists in linq is tricky, in this article we will see how we can join two lists by using inner join and then by using outer join. Using inner join is quite similar to sql inner join but outer join is a little different, so we will see it with example code as well as records (output). So let's check the data, two generic lists which we will use in our example List1:... By Hamden   On 25 Sep 2013  Viewed: 38,431
  • linq
  • c#

Send email in background thread in C# aps.net

How to send email in a new thread in asp.net by using Gmail account or any other account or you can say a page where we can test out all the settings like SMTP Server, Email From, Email To, Email Password, Port Number, Email DeliveryMethod or Secure Socket etc. In this article we will see how to send email in background thread with CCed and BCCed functionality. Here is the page... By Hamden   On 13 Sep 2013  Viewed: 38,014
  • email
  • asp.net
  • c#

Angularjs Bootstrap Datepicker enable/disable dates with configuration example

Adding calendar to the angularjs application is more than easy to any other application if you configured it properly. Angularjs Bootstrap DatePicker have more features than any other available calendar, you can set all your condition in html from data format to min-date, max-date, date disabled for Saturday and Sunday, first day of the week, todays button text, Week button text, close button... By Ali Adravi   On 22 Sep 2015  Viewed: 35,556
  • angularjs
  • bootstrap
  • Datepicker
  • Calendar

Image gallery in asp.net mvc with multiple file and size

Image gallery in asp.net mvc or in any other language can be achieved by using different free JavaScript libraries. What we need for a good image gallery, at least we need images in two sizes to show thumbnail and then the original image on clicking the image. In this article we will write a small method to calculate the new image size and save images in multiple sizes. To upload image we will... By Ali Adravi   On 10 Jan 2015  Viewed: 35,346
  • mvc
  • c#
  • image
  • image-gallery
  • asp.net
12345 ... 12Next