Describe how the ASP.NET authentication process works
ASP.NET runs inside the process of IIS due to which there are two authentication layers which exist in the system.
First authentication happens at the IIS level and the second at ASP.NET level per the WEB.CONFIG file.
Working:
At first, IIS ensures that the incoming request is from an authenticated IP address.
Otherwise the request is rejected.
By default IIS allows anonymous access due to which requests are automatically authenticated.
However, if this is changed, IIS performs its own user authentication too.
ASP.net checks if impersonation is enabled if a request is passed to ASP.net by an authenticated user. If it is enabled, ASP.net acts itself as an authenticated user else it acts with its own configured account.
Finally the OS resources are requested by the identity obtained from previous step.
The user is granted the resources if the authentication is successful else the resources are denied.
Resources can include ASP.net page, code access security features to extend authorization step to disk files, registry keys, etc.
How to use performance monitor to diagnose bottlenecks in your application?
Monitor is a tool built to assist you in diagnosing the problem.
Type ‘perfmon’ in command prompt to access Performance Monitor
The counters, sampling intervals, etc can be used to monitor the performance.
A baseline should be established so that critical reference points, changes and trends can be observed and identified.
Results can be made more readable by removing all the distracting sample noise so that the graphical view of trend lines is not blurred. This can be done using buckets - a vertical line, indicating the minimum, average, and maximum of the sample points in the bucket.
It should be noted that the bottlenecks can be caused due to over utilization of physical disk, memory, process, CPU, and network.
Describe the basic schema of a .config file.
Configuration File Schema for the .NET Framework
Configuration Files are standard XML files.
The elements that implement configuration settings are:
<configuration> Element is the top-level element for all configuration files.
<assemblyBinding> Element specifies assembly binding policy at the configuration level.
<linkedConfiguration> Element specifies a configuration file to include.
The configuration schema is for the machine configuration file, application configuration files, and the security configuration file. The following schemas describe their element purposes:
- Startup Settings Schema – specification of version of the CLR to be used.
- Runtime Settings Schema – configuration of assembly binding and runtime behavior.
- Network Settings Schema – specification of .NET connection to the Internet. \
- Cryptography Settings Schema - mapping friendly algorithm names to classes that implement cryptography algorithms.
- Configuration Sections Schema - creation and use of configuration sections for custom settings.
- Trace and Debug Settings Schema – specification of trace switches and listeners.
- Compiler and Language Provider Settings Schema – specification of compiler configuration for available language providers.
- Application Settings Schema – enabling Windows Forms or ASP.NET applications to store and retrieve application-scoped and user-scoped settings.
What is a good C# ASP.NET MVC question to ask a prospective employee?
First things first. Do they even know what MVC. Not just the TAL but can they describe it to you. Then what are the benefits. Also it doesn't hurt to ask them their opinion on it. It is good to know if they even like MVC frameworks.
Next, ask them if they have used any other MVC frameworks. Struts, Spring MVC, Zend or anything like that.
Ask them if they know when a session starts, the general state problem on the net etc etc.
Also a little bit of database. Ask them if they have any experience with database persistence layers.
Then just because you can ask a hard technical question, ask them to write a function that compares two binary trees both in value and structure to see if they are identicial.
ASP.NET Master Pages – Interview Questions
What is Master Page in ASP.NET?
A Master page offers a template for one or more web forms. It defines placeholders for the content, which can be overridden by the content pages. The content pages contains only content. When users request the content page, ASP.NET merges the layout of the master page with the content of the content page and produce output.
Advantages of using Master Page in ASP.NET
Master pages enables consistent and standardized layout to the website.
You can make layout changes of the site in the master page instead of making change in the pages.
It is very easy to implement.
Advantages and disadvantages of using multithreading
Advantages:
Simultaneous access to multiple applications
Reduced number of required servers
Improved performance and concurrency
Simplified coding of remote procedure calls and conversations
Disadvantages:
Code writing, debugging, managing concurrency, testing, porting existing code is difficult in multithreading and multicontexting.
Programmers need to remove static variables and replace any code that is not thread-safe to introduce threading into a previously non threaded application.
.NET interview: What is ADO.NET?
ADO.NET is a part of the Microsoft .NET Framework. This framework provides the set of classes that deal with data communication between various layers of the software architecture and the database. It provides a continious access to different data source types such as SQL Server versions 7, 2000, 2005. It also provides connectivity options to data sources through OLE DB and XML. Connectivity may be established with other databases like Oracle, MySQL etc. as well.
ADO.NET has the ability to separate data access
mechanisms, data manipulation mechanisms and data connectivity mechanisms.
ADO.NET introduces along with it the disconnected architecture. In a disconncted architecture, data may be stored in a DataSet. It contains providers for connecting to databases, commands for execution and retrieval of results.
The classes for ADO.NET are stored in the DLL System.Data.dll.
.NET WebDev interview questions
9. How will you identify which event in the ASP.NET Web page life cycle takes the longest time to execute? A. Turn on ASP.NET trace and run the Web application. B. Add a few code to each of the page life-cycle events that will print the current time. C. In the Web.config file, add the monitorTimings attribute and set it to True. D. In the Web site properties, turn on the performance monitor and run the Web application. After that, open performance monitor to see the timings.
11. You are interested in examining the data that is posted to the Web server. What trace result section can you use to see this information?A. Control Tree B. Headers Collection C. Form Collection D. Server Variables
12. While creating web site you need to add an HTML Web server control to the Web page, you need to drag an HTML element from the ToolBox of Visual Studio 2005 to the Web page and then which of the following tasks you will perform? A. Right-click the HTML element and click Run=Server. B. Double-click the HTML element to convert it to an HTML server control. C. Right-click the HTML element and click Run As Server Control. D. Click the HTML element and set ServerControl to true in the Properties window.
13. While testing your ASP.NET web application you noticed that while clicking on CheckBox of one of the web page it does not cause a PostBack; you required that the CheckBox should make PostBack so Web page can be update on the server-side code. How can you make the CheckBox to cause a PostBack? A. Set the AutoPostBack property to true. B. Add JavaScript code to call the ForcePostBack method. C. Set the PostBackAll property of the Web page to true. D. Add server-side code to listen for the click event from the client.
14. While writing code in Visual Studio 2005 you creates a new instance of a ASP.NET TextBox server control, what do you need to do to get the TextBox to display on the Web page? A. Call the ShowControl method on the TextBox. B. Set the VisibleControl to true on the TextBox. C. Add the TextBox instance to the form1.Controls collection. D. Execute the AddControl method on the Web page.
15. While creating your ASP.NET web based application you want to create multiple RadioButton server controls which should be mutually exclusive, what property of RadioButton server controls you must set? A. Exclusive B. MutuallyExclusive C. Grouped D. GroupName
16. While creating an ASP.NET web application with the help of Visual Studio 2005 you are creates a Web page that has several related buttons, such as fast-forward, reverse, play, stop, and pause. There should be one event handler that handles the processes of PostBack from these Button server controls. Other than the normal Submit button, what type of button can you create? A. OneToMany B. Command C. Reset D. ManyToOne