Showing posts with label MVC. Show all posts
Showing posts with label MVC. Show all posts

Saturday, 29 September 2018

Display uploaded file content from Database in MVC


In this article I would like to know you about display file content from  Database to the  in iframe. To create the database I used Code First approach using Entityframework in MVC application.
For that, Take an empty MVC application and add a class named Database and implement the interface DbContext as below :

Wednesday, 26 September 2018

Display File Content From Selected file in IFrame in MVC using JQuery


            In this article I would like to know you about displaying the choosen file content from  file selected from choosen input control to show in iframe. For this take a controller named ‘FileContentController’ and add a view to the ‘index’ action method, as the code shown below :

Friday, 21 September 2018

Different ways to Pass Data From View to controller in MVC and Partial Views in MVC


In this article, I would like to know you about, how to pass data from view to controller.
We can pass data from view to controller in three ways:
1)        Pass data as parameters
2)      Pass data as FormCollection
3)      Pass data as Model
For this, I had taken three classes, one is ItemModel, ResultModel and ItemViewModel

Saturday, 28 April 2018

Issues while using AngularJS with MVC


Issues while using AngularJS with MVC :
1.         Routing and Redirection becomes difficult : When we are trying to route, both the AngularJS and MVC are having routing concept, So the application gets confused to which routing should follow. And it stucked in the same page if we want to redirect to other page, actually in angularjs we use $state.go() for routing between the pages, and in MVC we use ActionResult to return View(), If we use MVC routing then we have to use $window.location.href instead of $state.go() (here state does not maintain in between controllers by using AngularJS with MVC.

Sunday, 3 September 2017

ViewBag In MVC Application

In This Article, I would like to know you about the Use Of ViewBag In MVC Application.

Actually ViewBag is a dynamic property, which is used to pass data from Controller To Corresponding View.  And It Is The Wrapper Of ViewData i.e., ViewBag uses ViewData Internally  And ViewData Is Derived From Dictonary Class Called ViewDataDictionary. The Life Of ViewData Is Only Lies In Current Request,But If Redirection Occurs, Then It’s value becomes null. And It Does Not Require Typecasting. So It Is Slower Than ViewData.