300+ Net Micro Framework FAQs and Answers [Experienced / Freshers]

Net Micro Framework Interview Questions with Answers

Question: 1. What Is Mvc?

Answer:

MVC is a sample which is used to split the software’s implementation common sense into 3 components: fashions, perspectives, and controllers.

Question: 2. Can You Explain Model, Controller And View In Mvc?

Answer:

Model – It’s a enterprise entity and it’s far used to symbolize the application information.
Controller – Request despatched by using the person constantly scatters thru controller and it’s duty is to redirect to the unique view using View() method.
View – It’s the presentation layer of MVC.
ASP.NET Interview Questions
Question: 3. Explain The New Features Added In Version four Of Mvc (mvc4)?

Answer:

Following are features added newly:

Mobile templates
Added ASP.NET Web API template for growing REST primarily based offerings.
Asynchronous controller venture guide.
Bundling the java scripts.
Segregating the configs for MVC routing, Web API, Bundle and so forth.
Question: 4. Can You Explain The Page Life Cycle Of Mvc?

Answer:

Below are the processed followed within the series:

App initialization
Routing
Instantiate and execute controller
Locate and invoke controller action
Instantiate and render view.
ASP.NET Tutorial
Question: 5. What Are The Advantages Of Mvc Over Asp.Net?

Answer:

Provides a smooth separation of issues amongst UI (Presentation layer), model (Transfer gadgets/Domain Objects/Entities) and Business Logic (Controller).
Easy to UNIT Test.
Improved reusability of model and perspectives. We could have multiple perspectives that could point to the equal version and vice versa.
Improved structuring of the code.
MVC Framework Interview Questions
Question: 6. What Is Separation Of Concerns In Asp.Internet Mvc?

Answer:

It’s is the manner of breaking this system into diverse awesome features which overlaps in capability as low as possible. MVC pattern worries on setting apart the content material from presentation and statistics-processing from content.

Question: 7. What Is Razor View Engine?

Answer:

Razor is the primary main replace to render HTML in MVC 3. Razor turned into designed specially for view engine syntax. Main awareness of this would be to simplify and code-centered templating for HTML generation.

Below is the pattern of using Razor:

@version MvcMusicStore.Models.Customer

@ViewBag.Title = “Get Customers”;

@Model.CustomerName

MVC Framework Tutorial Microsoft Entity Framework Interview Questions
Question: 8. What Is The Meaning Of Unobtrusive Javascript?

Answer:

This is a trendy term that conveys a popular philosophy, similar to the term REST (Representational State Transfer). Unobtrusive JavaScript does not intermix JavaScript code on your web page markup.

Eg : Instead of using events like onclick and onsubmit, the unobtrusive JavaScript attaches to elements with the aid of their ID or class based totally at the HTML5 statistics- attributes.

Question: 9. What Is The Use Of Viewmodel In Mvc?

Answer:

ViewModel is a undeniable magnificence with residences, that is used to bind it to strongly typed view. ViewModel will have the validation rules described for its residences the usage of records annotations.

Framework7 Interview Questions
Question: 10. What You Mean By Routing In Mvc?

Answer:

Routing is a pattern matching mechanism of incoming requests to the URL patterns which can be registered in route table. Class – “UrlRoutingModule” is used for the equal procedure.

Microsoft Entity Framework Tutorial
Question: eleven. What Are Actions In Mvc?

Answer:

Actions are the strategies in Controller class that’s chargeable for returning the view or json facts. Action will in particular have return type – “ActionResult” and it will be invoked from method – “InvokeAction()” referred to as with the aid of controller.

Windows CE .NET Interview Questions
Question: 12. What Is Attribute Routing In Mvc?

Answer:

ASP.NET Web API supports this kind routing. This is added in MVC5. In this kind of routing, attributes are getting used to define the routes. This sort of routing gives greater manage over conventional URI Routing. Attribute Routing can be described at controller degree or at Action stage like –

[Route(“action = TestCategoryList”)] – Controller Level

[Route(“customers/TestCategoryId:int:min(10)”)] – Action Level

ASP.NET Interview Questions
Question: 13. Explain Json Binding?

Answer:

JavaScript Object Notation (JSON) binding help started out from MVC3 onwards thru the new JsonValueProviderFactory, which lets in the movement methods to just accept and model-bind information in JSON format. This is beneficial in Ajax situations like consumer templates and information binding that need to post facts lower back to the server.

Framework7 Tutorial
Question: 14. Explain Dependency Resolution?

Answer:

Dependency Resolver again has been added in MVC3 and it is greatly simplified the usage of dependency injection for your programs. This flip to be less difficult and useful for decoupling the utility additives and making them less complicated to check and more configurable.

Question: 15. Explain Bundle.Config In Mvc 4?

Answer:

“BundleConfig.Cs” in MVC4 is used to sign in the bundles via the bundling and minification system. Many bundles are brought by way of default together with jQuery libraries like – jquery.Validate, Modernizr, and default CSS references.

Unittest Framework Interview Questions
Question: 16. How Route Table Has Been Created In Asp.Internet Mvc?

Answer:

Method – “RegisterRoutes()” is used for registering the routes as a way to be added in “Application_Start()” method of global.Asax report, that’s fired while the software is loaded or commenced.

Unittest Framework Tutorial
Question: 17. Which Are The Important Namespaces Used In Mvc?

Answer:

Below are the important namespaces used in MVC:

System.Web.Mvc
System.Web.Mvc.Ajax
System.Web.Mvc.Html
System.Web.Mvc.Async
Dot Net Framework Interview Questions
Question: 18. What Is Viewdata?

Answer:

Viewdata incorporates the important thing, value pairs as dictionary and that is derived from elegance – “ViewDataDictionary“. In movement method we are setting the fee for viewdata and in view the fee can be fetched by way of typecasting.

MVC Framework Interview Questions
Question: 19. What Is The Difference Between Viewbag And Viewdata In Mvc?

Answer:

ViewBag is a wrapper around ViewData, which permits to create dynamic houses.

Advantage of viewbag over viewdata can be:

  300+ Log4j FAQs and Answers [Experienced / Freshers]

In ViewBag no need to typecast the objects as in ViewData.
ViewBag will take advantage of dynamic key-word that’s brought
in version 4.Zero. But earlier than the use of ViewBag we need to take into account that ViewBag is slower than ViewData.

Question: 20. Explain Tempdata In Mvc?

Answer:

TempData is once more a key, price pair as ViewData. This is derived from “TempDataDictionary” elegance. TempData is used when the records is to be used in  consecutive requests, this will be among the actions or among the controllers. This calls for typecasting in view.

Asp Dot Net Mvc 4 Interview Questions
Question: 21. What Are Html Helpers In Mvc?

Answer:

HTML Helpers are like controls in conventional web bureaucracy. But HTML helpers are greater light-weight compared to internet controls as it does not keep viewstate and events.
HTML Helpers returns the HTML string which can be at once rendered to HTML web page. Custom HTML Helpers additionally can be created with the aid of overriding “HtmlHelper” class. 
Question: 22. What Are Ajax Helpers In Mvc?

Answer:

AJAX Helpers are used to create AJAX enabled elements like as Ajax enabled forms and hyperlinks which performs the request asynchronously and these are extension strategies of AJAXHelper elegance which exists in namespace – System.Web.Mvc.

Question: 23. What Are The Options Can Be Configured In Ajax Helpers?

Answer:

Below are the alternatives in AJAX helpers:

Url – This is the request URL.
Confirm – This is used to specify the message that’s to be displayed in confirm field.
OnBegin – Javascript method name to be given here and this can be referred to as before the AJAX request.
OnComplete – Javascript approach call to take delivery of here and this may be called on the cease of AJAX request.
OnSuccess – Javascript method name to be given right here and this can be known as while AJAX request is a success.
OnFailure – Javascript approach name to be given right here and this could be known as whilst AJAX request is failed.
UpdateTargetId – Target element which is populated from the movement returning HTML.
Asp Dot Net Mvc Interview Questions
Question: 24. What Is Layout In Mvc?

Answer:

Layout pages are similar to master pages in traditional internet paperwork. This is used to set the common appearance throughout multiple pages. In every child web page we will discover – /p>

@

Layout = “~/Views/Shared/TestLayout1.Cshtml”;

This suggests toddler web page makes use of TestLayout page because it’s grasp page.

Microsoft Entity Framework Interview Questions
Question: 25. Explain Sections Is Mvc?

Answer:

Section are the a part of HTML which is to be rendered in format web page.

In Layout page we can use the below syntax for rendering the HTML –

@RenderSection(“TestSection”)

And in infant pages we are defining those sections as proven beneath –

@section TestSection

Test Content

If any toddler page does not have this section described then error might be thrown with the intention to keep away from that we will render the HTML like this –

@RenderSection(“TestSection”, required: fake)

Question: 26. Can You Explain Renderbody And Renderpage In Mvc?

Answer:

RenderBody is like ContentPlaceHolder in web paperwork. This will exist in format web page and it’ll render the child pages/views. Layout web page will have only one RenderBody() method. RenderPage additionally exists in Layout page and a couple of RenderPage() may be there in Layout page.

Asp Dot Net Database Interview Questions
Question: 27. What Is Viewstart Page In Mvc?

Answer:

This web page is used to make certain not unusual format web page will be used for multiple views. Code written on this document will be done first while utility is being loaded.

Framework7 Interview Questions
Question: 28. Explain The Methods Used To Render The Views In Mvc?

Answer:

Below are the techniques used to render the views from movement:

View() – To return the view from action.
PartialView() – To go back the partial view from motion.
RedirectToAction() – To Redirect to specific motion which may be in identical controller or in one of a kind controller.
Redirect() – Similar to “Response.Redirect()” in webforms, used to redirect to specific URL.
RedirectToRoute() – Redirect to motion from the desired URL however URL within the direction table has been matched.
Question: 29. What Are The Sub Types Of Actionresult?

Answer:

ActionResult is used to symbolize the action technique end result.

Below are the subtypes of ActionResult:

ViewResult
PartialViewResult
RedirectToRouteResult
RedirectResult
JavascriptResult
JSONResult
FileResult
HTTPStatusCodeResult
.Net Deployment Interview Questions
Question: 30. What Are Non Action Methods In Mvc?

Answer:

In MVC all public strategies have been handled as Actions. So in case you are developing a method and if you do not need to use it as an motion method then the approach must be decorated with “NonAction” attribute as shown beneath –

[NonAction]

public void TestMethod()

// Method good judgment

Question: 31. How To Change The Action Name In Mvc?

Answer:

“ActionName” characteristic may be used for changing the action call.

Below is the pattern code snippet to demonstrate greater:

[ActionName(“TestActionNew”)]

public ActionResult TestAction()

go back View();

So in the above code snippet “TestAction” is the unique motion name and in “ActionName” attribute, name – “TestActionNew” is given. So the caller of this motion approach will use the call “TestActionNew” to name this action.

Question: 32. What Are Code Blocks In Views?

Answer:

Unlike code expressions which can be evaluated and despatched to the reaction, it’s miles the blocks of code which can be achieved. This is beneficial for affirming variables which we can be required for use later.

@

 int x = 123;

 string y = “aa”;

Asp Dot Net Ajax Interview Questions
Question: 33. What Is The “helperpage.Isajax” Property?

Answer:

  300+ Reserve Bank Of India (rbi) FAQs and Answers [Experienced / Freshers]

The HelperPage.IsAjax property receives a fee that indicates whether Ajax is getting used at some point of the request of the Web web page.

Windows CE .NET Interview Questions
Question: 34. How We Can Call A Javascript Function On The Change Of A Dropdown List In Mvc?

Answer:

Create a JavaScript method:

Invoke the approach:

<%:Html.DropDownListFor(x => x.SelectedProduct, new SelectList(Model.Customers, “Value”, “Text”), “Please Select a Customer”, new  identity = “ddlCustomers”, onchange=” DrpIndexChanged ()” )%>

Question: 35. What Are Validation Annotations?

Answer:

Data annotations are attributes which can be observed in the “System.ComponentModel.DataAnnotations” namespace. These attributes could be used for server-side validation and patron-side validation is also supported. Four attributes – Required, String Length, Regular Expression and Range are used to cover the common validation eventualities.

Question: 36. Why To Use Html.Partial In Mvc?

Answer:

This method is used to render the desired partial view as an HTML string. This technique does no longer depend on any movement methods.

We can use this like beneath:

@Html.Partial(“TestPartialView”)

Unittest Framework Interview Questions
Question: 37. What Is Html.Renderpartial?

Answer:

Result of the method – “RenderPartial” is directly written to the HTML reaction. This approach does no longer return something (void). This technique also does no longer depend on action techniques. RenderPartial() method calls “Write()” internally and we have to ensure that “RenderPartial” technique is enclosed within the bracket.

Below is the sample code snippet:

@Html.RenderPartial(“TestPartialView”); 

Question: 38. What Is Routeconfig.Cs In Mvc 4?

Answer:

“RouteConfig.Cs” holds the routing configuration for MVC. RouteConfig might be initialized on Application_Start event registered in Global.Asax.

Question: 39. What Are Scaffold Templates In Mvc?

Answer:

Scaffolding in ASP.NET MVC is used to generate the Controllers,Model and Views for create, examine, update, and delete (CRUD) capability in an application. The scaffolding might be understanding the naming conventions used for fashions and controllers and perspectives.

Question: 40. Explain The Types Of Scaffoldings.

Answer:

Below are the forms of scaffoldings:

Empty
Create
Delete
Details
Editist
Dot Net Framework Interview Questions
Question: 41. Can A View Be Shared Across Multiple Controllers? If Yes, How We Can Do That?

Answer:

Yes, we are able to share a view throughout multiple controllers. We can positioned the view inside the “Shared” folder. When we create a new MVC Project we will see the Layout page could be introduced within the shared folder, that is because it is utilized by more than one infant pages.

Question: forty two. What Are The Components Required To Create A Route In Mvc?

Answer:

Name – This is the name of the direction.
URL Pattern – Placeholders may be given to fit the request URL sample.
Defaults –When loading the application which controller, motion to be loaded together with the parameter.
Asp Dot Net Mvc four Interview Questions
Question: 43. Why To Use “useful resource.Axd/*pathinfo” In Routing In Mvc?

Answer:

Using this default course – useful resource.Axd/*pathInfo, we are able to save you the requests for the net sources documents like – WebResource.Axd or ScriptResource.Axd from passing to a controller.

Question: forty four. Can We Add Constraints To The Route? If Yes, Explain How We Can Do It?

Answer:

Yes we are able to upload constraints to path in following methods:

Using Regular Expressions
Using item which implements interface – IRouteConstraint.
Question: forty five. What Are The Possible Razor View Extensions?

Answer:

Below are the two sorts of extensions razor view can have:

.Cshtml – In C# programming language this extension can be used.
.Vbhtml – In VB programming language this extension can be used.
Question: 46. What Is Partial View In Mvc?

Answer:

Partial View is similar to User Controls in traditional web bureaucracy. For re-usability purpose partial views are used. Since it’s been shared with more than one views these are kept in shared folder. Partial Views can be rendered in following approaches –

Html.Partial()

Html.RenderPartial()

Question: forty seven. How We Can Add The Css In Mvc?

Answer:

Below is the sample code snippet to feature css to razor views:

 

Question: 48. Can I Add Mvc Test Cases In Visual Studio Express?

Answer:

No. We cannot upload the take a look at instances in Visual Studio Express version it may be brought handiest in Professional and Ultimate versions of Visual Studio.

Question: 49. What Is The Use .Glimpse In Mvc?

Answer:

Glimpse is an open source device for debugging the routes in MVC. It is the client side debugger. Glimpse has to be became on by traveling to neighborhood url hyperlink –

http://localhost:portname//glimpse.Axd
 This is a popular and beneficial device for debugging which tracks the velocity information, url information etc.

Question: 50. What Is The Need Of Action Filters In Mvc?

Answer:

Action Filters permit us to execute the code before or after motion has been accomplished. This can be accomplished by means of adorning the movement methods of controls with MVC attributes.

Question: fifty one. Mention Some Action Filters Which Are Used Regularly In Mvc?

Answer:

Below are a few action filters used:

Authentication
Authorization
HandleError
OutputCache
Question: 52. How Can We Determine Action Invoked From Http Get Or Http Post?

Answer:

This may be performed in following way:

 Use magnificence – “HttpRequestBase” and use the method – “HttpMethod” to decide the action request kind.
Question: 53. In Server How To Check Whether Model Has Error Or Not In Mvc?

Answer:

Whenever validation fails it is going to be tracked in ModelState.

By using property – IsValid it can be decided.

In Server code, take a look at like this –

if(ModelState.IsValid)

 // No Validation Errors

Question: fifty four. How To Make Sure Client Validation Is Enabled In Mvc?

Answer:

In Web.Config there are tags known as – “ClientValidationEnabled” and “UnobtrusiveJavaScriptEnabled”. We can set the patron aspect validation simply through putting those  tags “actual”, then this putting might be applied on the utility level.

  300+ Sap Hana FAQs and Answers [Experienced / Freshers]

 

 

Question: 55. What Are Model Binders In Mvc?

Answer:

For Model Binding we can use magnificence referred to as – “ModelBinders”, which gives get admission to to all the version binders in an utility. We can create a custom version binders by using inheriting “IModelBinder”.

Question: 56. How We Can Handle The Exception At Controller Level In Mvc?

Answer:

Exception Handling is made easy in MVC and it is able to be executed with the aid of just overriding “OnException” and set the result belongings of the filtercontext object (as shown below) to the view detail, that’s to be again in case of exception.

Covered overrides void OnException(ExceptionContext filterContext)

Question: 57. Does Tempdata Hold The Data For Other Request In Mvc?

Answer:

If Tempdata is assigned within the cutting-edge request then it is going to be available for the present day request and the subsequent request and it depends whether facts in TempData examine or no longer. If information in Tempdata is study then it would not be to be had for the following requests.

Question: 58. Explain Keep Method In Tempdata In Mvc?

Answer:

As defined above in case records in Tempdata has been examine in present day request simplest then “Keep” method has been used to make it to be had for the following request.

@TempData[“TestData”]; 

TempData.Keep(“TestData”);

Question: 59. Explain Peek Method In Tempdata In Mvc?

Answer:

Similar to Keep technique we’ve got one extra technique referred to as “Peek” that is used for the identical reason. This technique used to examine data in Tempdata and it keeps the statistics for next request.

 String A4str = TempData.Peek(“TT”).ToString();

Question: 60. What Is Area In Mvc?

Answer:

Area is used to shop the details of the modules of our project. This is really beneficial for big packages, where controllers, perspectives and fashions are all in fundamental controller, view and model folders and it is very difficult to manipulate.

Question: sixty one. How We Can Register The Area In Mvc?

Answer:

When we have created a place make certain this can be registered in “Application_Start” event in Global.Asax. Below is the code snippet where area registration is carried out –

covered void Application_Start()

AreaRegistration.RegisterAllAreas();

Question: 62. What Are Child Actions In Mvc?

Answer:

To create reusable widgets toddler actions are used and this may be embedded into the discern views. In MVC Partial views are used to have reusability in the utility. Child movement mainly returns the partial perspectives.

Question: sixty three. How We Can Invoke Child Actions In Mvc?

Answer:

“ChildActionOnly” attribute is embellished over movement methods to signify that movement approach is a toddler movement. Below is the code snippet used to indicate the kid action –

[ChildActionOnly]

public ActionResult MenuBar()

//Logic here

return PartialView();

Question: sixty four. What Is Dependency Injection In Mvc?

Answer:

It’s a design pattern and is used for developing loosely couple code. This is substantially used within the software program initiatives. This will lessen the coding in case of changes on venture design so this is hugely used.

Question: 65. Explain The Advantages Of Dependency Injection (di) In Mvc?

Answer:

Below are the blessings of DI:

Reduces class coupling
Increases code reusing
Improves code maintainability
Improves utility testing
Question: 66. Explain Test Driven Development (tdd) ?

Answer:

TDD is a technique which says, write your exams first earlier than you write your code. In TDD, exams drive your software design and improvement cycles. You do now not do the test-in of your code into source manipulate until all of your unit checks skip.

Question: 67. Explain The Tools Used For Unit Testing In Mvc?

Answer:

Below are the equipment used for unit checking out:

NUnit
xUnit.NET
Ninject 2
Moq 
Question: sixty eight. What Is Representational State Transfer (relaxation) Mean?

Answer:

REST is an architectural style which uses HTTP protocol methods like GET, POST, PUT, and DELETE to get entry to the information. MVC works in this fashion. In MVC four there is a support for Web API which uses to construct the provider using HTTP verbs.

Question: 69. How To Use Jquery Plugins In Mvc Validation?

Answer:

We can use dataannotations for validation in MVC. If we want to apply validation for the duration of runtime the usage of Jquery then we are able to use Jquery plugins for validation.

Eg: If validation is to be performed on patron name textbox then we will do as –

$(‘#CustomerName’).Regulations(“add”, 

required: actual,

minlength: 2,

messages: 

required: “Please enter name”,

minlength: “Minimum period is two”

);

Question: 70. What Are The Differences Between Partial View And Display Template And Edit Templates In Mvc?

Answer:

Display Templates – These are version centric. Meaning it relies upon on the houses of the view model used. It uses convention in order to simplest display like divs or labels.
Edit Templates – These are also model centric however will have editable controls like Textboxes.
Partial View – These are view centric. These will fluctuate from templates by way of the way they render the properties (Id’s) Eg : CategoryViewModel has Product magnificence assets then it will likely be rendered as Model.Product.ProductName but in case of templates if we CategoryViewModel has List then @Html.DisplayFor(m => m.Products) works and it renders the template for every object of this list.
 

Question: 71. Can I Set The Unlimited Length For “maxjsonlength” Property In Config?

Answer:

No. We can’t set limitless period for assets maxJsonLength. Default value is – 102400 and maximum fee what we can set would be – 2147483644.

Question: seventy two. Can I Use Razor Code In Javascript In Mvc?

Answer:

Yes. We can use the razor code in javascript in cshtml with the aid ofusingelement.

 

Question: 73. How Can I Return String Result From Action In Mvc?

Answer:

Below is the code snippet to return string from action technique:

public ActionResult TestAction() 

go back Content(“Hello Test !!”);

 

Question: 74. How To Return The Json From Action Method In Mvc?

Answer:

Below is the code snippet to go back string from action method:

public ActionResult TestAction() 

go back JSON(new  prop1 = “Test1”, prop2 = “Test2” );

 

Question: seventy five. How We Can Override The Action Names In Mvc?

Answer:

If we want to override the action names we will do like this:

[ActionName(“NewActionName”)]

public ActionResult TestAction() 

go back View();

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top