.NET MVC

.Net MVC

Trending Questions and Lessons

Follow 17,768 Followers

Ask a Question

Feed

All

All

Lessons

Discussion

Lesson Posted on 12 Mar .Net/.Net MVC

C# (Sharp) Syllabus

Arvind Yadav

I have ? 5 years of experience in Software with expertise on .Net Platform. ? Excellence in Client...

C# (Sharp) Syllabus: C# (Sharp) Syllabus Lesson 01: Getting Started Lesson 02: Expressions, Types, and Variables Lesson 03: Control Statements - Selection Lesson 04: Control Statements - Loops Lesson 05: Methods Lesson 06: Namespaces Lesson 07: Introduction... read more

C# (Sharp) Syllabus: 

C# (Sharp) Syllabus
Lesson 01: Getting Started
Lesson 02: Expressions, Types, and Variables
Lesson 03: Control Statements - Selection
Lesson 04: Control Statements - Loops
Lesson 05: Methods
Lesson 06: Namespaces
Lesson 07: Introduction to Classes
Lesson 08: Class Inheritance
Lesson 09: Polymorphism
Lesson 10: Properties
Lesson 11: Indexers
Lesson 12: Structs
Lesson 13: Interfaces
Lesson 14: Introduction to Delegates and Events
Lesson 15: Introduction to Exception Handling
Lesson 16: Using Attributes
Lesson 17: Enums
Lesson 18: Overloading Operators
Lesson 19: Encapsulation
Lesson 20: Introduction to Generic Collections
Lesson 21: Anonymous Methods
Lesson 22: Topics on C# Type
Lesson 23: Working with Nullable Types
read less
Comments
Dislike Bookmark

Answered on 19 Apr .Net/.Net MVC

Tag11 Infotech Pvt. Ltd.

Yes, You can learn MVC, it will be more Addon for your job profile, that may increase your salary
Answers 3 Comments
Dislike Bookmark

Answered on 12 Jan .Net/.Net MVC .Net/ASP.NET

What is the future of ASP.Net Software Developer as .Net MVC is in great demand?

Mlewzklawz It Solutions Pvt. Ltd.

Tutor

It has grate demand. Even go for Silverlight that has more opening.
Answers 2 Comments
Dislike Bookmark

Looking for .NET MVC

Find best .NET MVC in your locality on UrbanPro.

FIND NOW

Answered on 11 Jan .Net .Net/.Net MVC .Net/.Net Web Services

Manoj Kumar Vishwakarma

MS SQL DBA Trainer

In php developing an app is easy.
Answers 36 Comments 1
Dislike Bookmark

Lesson Posted on 23/11/2017 .Net/C# .NET .Net/.Net MVC .Net/.Net WCF +5 .Net/.Net Web Services IT Courses/Angular.JS IT Courses/HTML IT Courses/CSS IT Courses/jQuery less

Pro Developer Program Syllabus

DeCode Classes

DeCode Classes is based at Pune, India. DeCode is an outcome of joint and co-operative venture of...

What you will learn in Pro-Developer Program: i. Introduction to Web Technologies. ii. Introduction to .Net - Features of .Net, CTS, CLS, CLR and MSIL. iii. C# & .Net Basics - Data Types, Type Conversions and Methods in C#. iv. Branching & Flow Control - Looping, Conditional &... read more

What you will learn in Pro-Developer Program:

i. Introduction to Web Technologies.
 
ii. Introduction to .Net - Features of .Net, CTS, CLS, CLR and MSIL.
 
iii. C# & .Net Basics - Data Types, Type Conversions and Methods in C#.
 
iv. Branching & Flow Control - Looping, Conditional & Unconditional Branching, Repeating Code Blocks.
 
v. Object Oriented Programming - OOPs Concepts, Abstract Classes & Methods, Name Spaces.
 
vi. Exception Handling – Error Handling, System Defined Exceptions, Try, Catch & Finally.
 
vii. Delegates and Events, Generics.
 
viii. Asp.Net Introduction.
 
ix. Client Side & Server Side (ASP) Controls, HTML Server & Web Server Controls.
 
x. Validating User Input.
 
xi. .Net WebForms.
 
xii. State Management: Session States & Tracing, Page Submission & Cookies.
 
xiii. ADO.Net and Bound Controls in Asp.Net: Data List, Retrieve Data, SQL data Source.
 
xiv. ADO.Net and Bound Controls in Asp.Net: Form view, Details View and Grid View.
 
xv. Data Connections with Various Databases.

xvi. Database Creation & Linking with UI.

xvii. Data Binding: Data Source Control, SqlDataSource Control.

xviii. Data Binding: ObjectDataSource Control, XmlDataSource Control.

xix. .Net Error Handling & Debug: Page Level & Application Level Handling.

xx. Security in .Net: Authentication & Authorization, Authorizing Users and roles.

xxi. Security in .Net: Windows, Forms, Password Authentication.

xxii. Site Navigation.

xxiii. Ajax Introduction: Explaining Controls in Ajax Tool Kit.

xxiv. Web Parts: Zone Types, Content & Catalog web part and Personalization Features using web parts.

xxv. .Net Additional Concepts: Web Services, Working with Master Pages.

xxvi. GUI Application Development: Creating Menus, Toolbars, Tree & List View.

xxvii. GUI Application Development: Programming with Advanced Controls.

xxviii. Database Programming (ADO.Net): A Review of Classic ASP.

xxix. Introduction to AngularJS:

1. AngularJS Expressions: Numbers, Strings, Objects, Arrays, Expressions using {{ }} and ng-bind.

2. Modules: Creating a module, adding a controller & directive, myApp.js, myCtrl.js, Loading library.

3. Directives: Data Binding, ng-init, ng-repeat, ng-app & ng-model directives, custom directives.

4. Model: 2 way binding, Validating User Input, Status, ng-empty, ng-touched, ng-valid, ng-pending.

5. Data Binding: Synchronization between model and view.

6. AngularJS Controllers: ng-controller, Controller Methods, External Files.

7. Scope: $scope, understanding the scope, $rootScope.

8. Filters: Adding filters to directives, Currency filter, Array filter, Custom filters.

9. Services: Built-in & Own service, $http, $timeout, $interval, Custom service.

10. AngularJs $http: Methods, get(), post(), Properties, .config, .data, JSON format.

11. Tables: Working with Tables, $index, $even & $odd.

12. Select: Creating dropdown lists, ng-options and ng-repeat, Objects.

13. AngularJS SQL: Fetching Data, Cross site HTTP Requests, Server Code.

14. DOM: ng-disabled directive, ng-show directive, nd-hide directive.

15. Events: Working with events, Mouse events, ng-click, Toggle, $event object.

16. Forms: Working with Forms, Checkbox, Radiobuttons, Select, formCtrl, reset().

17. Form Validation: Client side form validation, Form state & Input state, Custom validations.

18. AngularJS API: Comparing objects, Iterating objects, Converting data.

19. Applying CSS styles: Inilne, Embedded and External Styles, Classes.

20. Bootstrap: Bootstrap Overview, Features, Using bootstrap, Grid, Navigation, Layout.

21. AngularJS: Routing, ngRoute, $routeProvider, Controller & Template.

read less
Comments
Dislike Bookmark

Lesson Posted on 25/09/2017 IT Courses/Angular.JS IT Courses/Java Script Training IT Courses/jQuery +2 .Net .Net/.Net MVC less

Dependency Injection in Angular 2

Ranjan Panda

I am .Net Trainer with more than 6 years Industry experience in Microsoft .net technologies, Expertise...

Dependency injection Dependency injection is a way to supply a new instance of a class with the fully-formed dependencies it requires. Most dependencies are services. Angular uses dependency injection to provide new components with the services they need. Angular can tell which services a component... read more

Dependency injection

Service

Dependency injection is a way to supply a new instance of a class with the fully-formed dependencies it requires. Most dependencies are services. Angular uses dependency injection to provide new components with the services they need.

Angular can tell which services a component needs by looking at the types of its constructor parameters. For example, the constructor of your HeroListComponent needs a HeroService:

Sample Code-

src/app/hero-list.component.ts (constructor)
constructor(private service: HeroService) { }

When Angular creates a component, it first asks an injector for the services that the component requires.

An injector maintains a container of service instances that it has previously created. If a requested service instance is not in the container, the injector makes one and adds it to the container before returning the service to Angular. When all requested services have been resolved and returned, Angular can call the component's constructor with those services as arguments. This is dependency injection.

The process of HeroService injection looks a bit like this:

Service

If the injector doesn't have a HeroService, how does it know how to make one?

In brief, you must have previously registered a provider of the HeroService with the injector. A provider is something that can create or return a service, typically the service class itself.

You can register providers in modules or in components.

In general, add providers to the root module so that the same instance of a service is available everywhere.

src/app/app.module.ts (module providers)
providers: [
BackendService,
HeroService,
Logger
],

Alternatively, register at a component level in the providers property of the @Component metadata:

src/app/hero-list.component.ts (component providers)
@Component({
  selector:    'hero-list',
  templateUrl: './hero-list.component.html',
  providers:  [ HeroService ]
})

Registering at a component level means you get a new instance of the service with each new instance of that component.

Points to remember about dependency injection:

  • Dependency injection is wired into the Angular framework and used everywhere.

  • The injector is the main mechanism.

    • An injector maintains a container of service instances that it created.
    • An injector can create a new service instance from a provider.
  • provider is a recipe for creating a service.

  • Register providers with injectors.

read less
Comments 1
Dislike Bookmark

Looking for .NET MVC

Find best .NET MVC in your locality on UrbanPro.

FIND NOW

Lesson Posted on 25/09/2017 .Net .Net/.Net MVC IT Courses/Angular.JS +2 IT Courses/Programming Languages/C Sharp IT Courses/Java Script Training less

Inversion of Control

Ranjan Panda

I am .Net Trainer with more than 6 years Industry experience in Microsoft .net technologies, Expertise...

Problem You have classes that have dependencies on services or components whose concrete type is specified at design time. In this example, ClassA has dependencies on ServiceA and ServiceB. Figure 1 illustrates this. Figure 1 ClassA has dependencies on ServiceA and ServiceB This situation has the... read more

Problem

You have classes that have dependencies on services or components whose concrete type is specified at design time. In this example, ClassA has dependencies on ServiceA and ServiceB. Figure 1 illustrates this.

Ff921087.35d9aa8f-1568-431b-9d7f-db477ae067dc(en-us,PandP.10).png

Figure 1 
ClassA has dependencies on ServiceA and ServiceB

This situation has the following problems:

  • To replace or update the dependencies, you need to change your classes' source code.
  • The concrete implementations of the dependencies have to be available at compile time.
  • Your classes are difficult to test in isolation because they have direct references to dependencies. This means that these dependencies cannot be replaced with stubs or mocks.
  • Your classes contain repetitive code for creating, locating, and managing their dependencies.

Forces

Any of the following conditions justifies using the solution described in this pattern:

  • You want to decouple your classes from their dependencies so that the dependencies can be replaced or updated with minimal or no changes to your classes' source code.
  • You want to write classes that depend on classes whose concrete implementations are not known at compile time.
  • You want to test your classes in isolation, without using the dependencies.
  • You want to decouple your classes from being responsible for locating and managing the lifetime of dependencies.

Solution

Delegate the function of selecting a concrete implementation type for the classes' dependencies to an external component or source.

Implementation Details

The Inversion of Control pattern can be implemented in several ways. The Dependency Injection pattern and the Service Locator pattern are specialized versions of this pattern that delineate different implementations. Figure 2 illustrates the conceptual view of both patterns.

Ff921087.bbfbea6f-4b25-4d01-8761-770a91838669(en-us,PandP.10).png

Figure2 
Conceptual view of the Service Locator and Dependency Injection patterns

For more information about these patterns, see Dependency Injection and Service Locator.

Examples

The following are example implementations of the Inversion of Control pattern:

  • In the Configuration Modularity QuickStarts, the class ModuleA defined in the ModuleA project uses dependency injection to obtain a reference to the region manager service, as shown in the following code.
     
    public class ModuleA : IModule
    {
        private readonly IRegionManager _regionManager;
    
        public ModuleA(IRegionManager regionManager)
        {
            _regionManager = regionManager;
        }
    
        ...
    }
    
    

    Because the ModuleA class is instantiated by a container and an instance of the region manager service is registered with the container, the ModuleA class receives a valid instance of the region manager service when it is constructed. Note that a mock instance of the region manager service can be supplied when testing the ModuleA class by passing the mock instance in the constructor's parameter.

  • The following code, extracted from the NewsModule class of the Stock Trader Reference Implementation (this class is located at StockTraderRI.Modules.News\NewsModule.cs), shows how an instance that implements the INewsController interface is obtained using the service locator pattern. The variable _container holds an instance to a container that has logic to locate a valid instance of the requested type.
     
    public void Initialize()
    {
        RegisterViewsAndServices();
        INewsController controller = _container.Resolve<INewsController>();
        controller.Run();
    }
    
    

    Note that for testing purposes, you could configure the container to return a mock instance that implements the INewsController interface instead of the real implementation. This enables you to test the NewsModule class in isolation. The following code, extracted from the NewsModuleFixture test class (located in StockTraderRI.Modules.News.Tests\NewsModuleFixture.cs), shows how the NewsModule class can be tested in isolation using a mock instance for the INewsController interface.

     
    [TestMethod]
    public void InitCallsRunOnNewsController()
    {
        MockUnityResolver container = new MockUnityResolver();
        var controller = new MockNewsController();
        container.Bag.Add(typeof(INewsController), controller);
        var newsModule = new NewsModule(container);
    
        newsModule.Initialize();
    
        Assert.IsTrue(controller.RunCalled);
    }
    
    

Liabilities

The Inversion of Control pattern has the following liabilities:

  • You need to implement a mechanism that provides the dependencies that are required by the object that is being initialized.
  • There is added complexity to the source code, which makes it harder to understand.
read less
Comments
Dislike Bookmark

Lesson Posted on 04/07/2017 .Net/.Net MVC

ASP.NET Web API 2 action method return types

Tutorial Plus

I have been teaching for 15 years, Started as full time trainer to part time trainer now. I have taught...

Here, in this article we will learn ASP.NET Web API 2 action method return types. A Web API 2 action method return types can be any of the following : Void HttpResponseMessage IHttpActionResult Other type or Complex type Void When an ASP.NET Web API return type is void, it will return... read more

Here, in this article we will learn ASP.NET Web API 2 action method return types.

A Web API 2 action method return types can be any of the following :

  • Void
  • HttpResponseMessage
  • IHttpActionResult
  • Other type or Complex type




A Web API 2 action method return types can be any of the following

Void

When an ASP.NET Web API return type is void, it will return an empty HTTP response.

In the following example a web API with void return:

Example

public class SampleController : ApiController
{
  public void Post()
   {
            
   }
}

Note: We are using fiddler to call Web API, it is a free web debugging proxy which logs all HTTP(s) traffic between your computer and the Internet



Result

Calling sample web API in fiddler
Web API 2 action method void return 


It is returning status code 204 No Content (an empty HTTP response)
Web API 2 action method void return status code 204 No Content (an empty HTTP response) 





 

HttpResponseMessage

  • When Web API return type is HttpResponseMessage, Web API converts the return value directly into an HTTP response message.
  • We can set the status code, content as per our requirement.

 

In the following example a web API with HttpResponseMessage return:

Example

public HttpResponseMessage Get()
{
    HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, "value1");            
    return response;
}


Result

Calling sample Web API with HTTP GET request
Web API 2 action method HttpResponseMessage return 


In Response, It is returning status code 200 OK and Content
Web API 2 action method void return status code 204 No Content (an empty HTTP response) 



Note:Web API serialized model into the response body based on request header formatter



In the following example a web API return HttpResponseMessage with list of Countries in response body:

Example

public HttpResponseMessage Get()
{
   // list of Countries
   List Countries = new List();
    Country country = new Country();
    country.ID = 1;
    country.CountryName = "USA";
    country.Capital = "Washington";
    Countries.Add(country);
        
    //Countries to the response body.             
    HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, Countries);            
    return response;
}


Result

In Response, It is returning status code 200 OK and Content
Web API 2 action method HttpResponseMessage return 






IHttpActionResult

IHttpActionResult is introduced in Web API 2, IHttpActionResult interface acts like a factory for HttpResponseMessage.

There are some advantages of using the IHttpActionResult over HttpResponseMessage

  • The code is cleaner and easier to read
  • Unit testing for controller action methods become easy
  • It comes with custom built in responses
    • Ok
    • NotFound
    • Exception
    • Unauthorized
    • BadRequest
    • Conflict
    • Redirect

In the following example a web API return IHttpActionResult with list of Countries in response body:

Example

public IHttpActionResult Get(int id)
{
   // list of Countries
   List Countries = new List();
    Country country = new Country();
    country.ID = 1;
    country.CountryName = "USA";
    country.Capital = "Washington";
    Countries.Add(country);
    
    //finding country based on provided id
    var result = Countries.FirstOrDefault(x=> x.ID ==id);
    if (result == null)
    {
        //create a 404 (Not Found) response
        return NotFound();                
    }
    else
    {
        //creates a 200 (OK) response that contains the country
        return Ok(result);
    }
}





Result

Calling sample web API with HTTP GET request and id
Web API 2 action method HttpResponseMessage return 


In Response, It is returning status code 200 OK and Content
Web API 2 action method HttpResponseMessage return 


Calling sample web API with HTTP GET request and id(which is not exist)
Web API 2 action method HttpResponseMessage return 


In Response, It is returning status code 404 Not Found
Web API 2 action method HttpResponseMessage return 






 

Other type or Complex type

  • A Web API can return other or custom complex type
  • Web API serialize value and return it into the response body
  • The response status code 200 OK
  • But in this approach we cannot directly return an error code, still we can throw an HttpResponseException for error codes

In the following example a web API with Complex return type:

Example

public class CountryController : ApiController
{
    public IEnumerable Get()
    {
        List Countries = new List();
        Country country = new Country();
        country.ID = 1;
        country.CountryName = "USA";
        country.Capital = "Washington";
        Countries.Add(country);
        return Countries;
    }
}

Result

Calling Country web API with HTTP GET request
Web API 2 action method Complex return type 


In Response, It is returning status code 200 OK and Content
Web API 2 action method void return status code 204 No Content (an empty HTTP response) 
read less
Comments
Dislike Bookmark

Answered on 27/06/2017 .Net/.Net MVC

Tech Altius

Hi Ashish, For MVC Project information please come at our center so that we can understand your whole requirement.
Answers 14 Comments
Dislike Bookmark

Looking for .NET MVC

Find best .NET MVC in your locality on UrbanPro.

FIND NOW

Answered on 17/02/2016 .Net/.Net MVC

Salim Ahmed

Software Trainer

Its 4500 for MVC Training. Classes will be held at my location .If interested can contact me
Answers 14 Comments
Dislike Bookmark

About UrbanPro

UrbanPro.com helps you to connect with the best .NET MVC in India. Post Your Requirement today and get connected.

Overview

Questions 16

Lessons 18

Total Shares  

Top Contributors

Connect with Expert Tutors & Institutes for .Net MVC

x

Ask a Question

Please enter your Question

Please select a Tag

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 25 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 6.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more