.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Sandeep Singh
Mayuri
stevemarkayden
kumarfurima
Preethi


Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Post New Question Subscribe to Interview Questions
 
Quick Links For Interview Questions Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  OOPs  JQuery  JavaScript/VBScript
BiztalkPatten/Practices.IISWCFWPFWWF
NetworkingAptitudeOthers  All    
 

Interview Questions And Answers

Can we share a view across multiple controllers ?

Author: Alankar          Posted Date: April 02, 2015    Category: MVC     Points: 40

Yes, It is possible to share a view across multiple controllers by putting a view into the shared folder.
By doing like this, you can automatically make the view available across multiple controllers.

Which namespace is used for ASP.NET MVC ?

Author: Alankar          Posted Date: April 02, 2015    Category: MVC     Points: 40

System.Web.Mvc namespace contains all the interfaces and classes which supports ASP.NET MVC framework for creating web applications.


Does the unit testing of an MVC application is possible without running controllers in an ASP.NET process ?

Author: Alankar          Posted Date: April 02, 2015    Category: MVC     Points: 40

In an MVC application, all the features are based on interface. So, it is easy to unit test a MVC application.
And it is to note that, in MVC application there is no need of running the controllers for unit testing.

Explain about Razor View Engine ?

Author: Alankar          Posted Date: April 02, 2015    Category: MVC     Points: 40

This Razor View engine is a part of new rendering framework for ASP.NET web pages.
ASP.NET rendering engine uses opening and closing brackets to denote code (<% %>), whereas Razor allows a cleaner, implied syntax for determining where code blocks start and end.

Example:

In the classic renderer in ASP.NET:

<ul>

<% foreach (var userTicket in Model)

{ %>

<li><%: userTicket.Value %></li>

<% } %>

</ul>



By using Razor:
<ul>

@foreach (var userTicket in Model)

{

<li>@userTicket.Value</li>

}

</ul>


Which assembly is used to define the MVC framework and Why ?

Author: Alankar          Posted Date: April 02, 2015    Category: MVC     Points: 40

The MVC framework is defined through System.Web.Mvc assembly.
This is because this is the only assembly which contains classes and interfaces that support the ASP.NET Model View Controller (MVC) framework for creating Web applications.

MVC means ?

Author: Alankar          Posted Date: April 02, 2015    Category: MVC     Points: 40

MVC stands for Model View Controller.
It divides an application into 3 component roles which is based on a framework methodology.
These component roles are discussed briefly as follows:

i) Models : These component roles are used to maintain the state which is persisted inside the Database.

Example: we might have a Product class that is used to represent order data from the Products table inside SQL.

ii) Views : These component roles are used to display the user interface of the application, where this UI is created off of the model data.

Example: we might create an Product "Edit" view that surfaces textboxes, dropdowns and checkboxes based on the current state of a Product object.

iii) Controllers : These component roles are used for various purposes like handling end user interaction, manipulating the model, and ultimately choosing a view to render to display UI.

Note:

In a MVC application, the views are used only for displaying the information whereas the controllers are used for handling and responding to user input and interaction.

How to enable the Performance Counters in WCF?

Author: Alankar          Posted Date: April 02, 2015    Category: WCF     Points: 40

Simple way to enable Performance Counters supported by WCF is as follows:
<system.serviceModel>
<diagnostics performanceCounters = "All" />
</system.serviceModel>
Above configuration setting will enable all categories of counters including ServiceModelService, ServiceModelEndpoint and ServiceModelOperation. Default value for it is "Off".

What is the role of transaction manager in WCF?

Author: Alankar          Posted Date: April 02, 2015    Category: WCF     Points: 40

Transaction manager while sitting on client side, initiate the transaction and coordinates with all the processes that participate in a distributed transaction to commit or roll back.

What is two-phase committed protocol?

Author: Alankar          Posted Date: April 02, 2015    Category: WCF     Points: 40

In a distributed transaction scenario, two-phase committed protocol is an algorithm that ensures all the participating processes in a distributed transaction are ready to be committed or roll backed. This is done in two phases i.e. Prepare phase and Commit phase.

What are the various Transaction Flow Options available in WCF?

Author: Alankar          Posted Date: April 02, 2015    Category: WCF     Points: 40

If a service is configured for Transaction Propagation, WCF further supports various options for service methods to be part of any transaction initiated outside service boundaries.
. NotAllowed Transaction Propagation is not allowed for particular service method. Its default value.
. Allowed Transaction Propagation is allowed but not compulsory.
. Mandatory Transaction Propagation is compulsory for that service method.
For example, Transaction Propagation is mandatory for CreditAccount service method in following code snippet.
[ServiceContract]
interface IPaymentService
{
[OperationContract]
[TransactionFlow(TransactionFlowOption.Mandatory)]
void CreditAccount(..);
}



Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend