Advanced MS.NET Interview Questions Answers asked in top companies.
What is context menu?The menu that you get when you right-click is called the context menu. It is a modular piece of markup code that can move around the page. It consists of two distinct blocks, one is the user interface and another is the script code to connect the UI to it.
Explain how to retrieve resources using ResourceManager class?
ResourceManager class is used to retrieve resources at run time.
• Create a ResourceManager with resource file name and the resource assembly as parameters.
• After having created, you can use ResourceManager.GetString method to retrieve a string.
• Use the ResourceManager.GetObject method to retrieve images and objects from a resource file.
What are the ways to retain variables between requests?
Below there are different ways to retain variables between requests. That is:
Context.Handler: This object can be used to retrieve public members of the webform from a subsequent web page.
Querystring: Querystring is used to pass information between requests as part of the web address. Since it is visible to use, we can't use it to send any secured data.
Cookies: Cookies stores small amount of information on client side. But we can't reply on cookies since many clients can refuse cookies.
View state: View state stores items added to the pages. These properties are as hidden fields on the page.
Session state: Session state stores items that are local to the current session.
Application state: Application state stores items that are available to all users of the application.
In .NET, which namespace contains classes used to a)Create a localized application? b)Develop Web Forms? c)Create Web server controls? d)Access Sql Server? e)Read a File?
a)System.Globalization, System.Resources
b)System.Web
c)System.Web.UI.WebControls
d)System.Data.SqlClient
e)System.IO
What is break mode? What are the options to step through code?
Break mode lets you to observe code line to line in order to locate error.
The VS.NET provides following options to step through code.
• Step Into
• Step Over
• Step Out
• Run To Cursor
• Set Next Statement
How do we step through code?
Stepping through the code is a way of debugging the code in which one line is executed at a time.
There are three commands for stepping through code:
Step Into: This debugging mode is usually time-consuming. However, if one wants to go through the entire code then this can be used. When you step into at a point and a function call is made somewhere in the code, then step into mode would transfer the control to the first line of the code of the called function.
Step Over: The time consumed by the Step into mode can be avoided in the step over mode. In this, while you are debugging some function and you come across another function call inside it, then that particular function is executed and the control is returned to the calling function.
Step Out: You can Use Step Out when you are inside a function call and want to return to the calling function. Step Out resumes execution of your code until the function returns, and then breaks at the return point in the calling function.
What are the debugging windows available?
The windows which are available while debugging are known as debugging windows.
These are: Breakpoints, Output, Watch, Autos, Local, Immediate, Call Stacks, Threads, Modules, Processes, Memory, Disassembly and Registers.
Explain the similarities and differences between arrays and collections?
• The Array class is not part of the System.Collections namespace. But an array is a collection, as it is based on the list interface.
• Array has a fixed capacity but the classes in the System.Collections namespace don’t have fixed capacity. That’s why array is a static container, but collection is dynamic container.
• Collections objects have a key associated with them. You can directly access an item in the collection by the key. But to find a specific item in an array, unless you don’t know the index number you need to traverse the array to find the value.
Explain declarative and imperative security?
Security checks can be applied in two ways that is imperatively or declaratively.
Declarative security is applied by associating attribute declarations that specify a security action with classes or methods.
Imperative security is applied by calling the appropriate methods of a Permission object that represents the Principal (for role based security) or system resource (for code access security).
What is code security? What are the types?
.NET framework provides the security features to secure code from unauthorized users.
There are two types of code security:
Role based security: This authorizes user.
Code access security: This protects system resources from unauthorized calls.
Define Principal object?
The Principal object represents authenticated users. It contains information about user’s identity and role. You have Principal Permission object in .NET Framework that specifies user and its role. It has Demand method that checks the current user or Principal against the name and role specified in the Principal Permission.
Which namespace contains the classes that required to serialize an object? Explain Object Serialization?
System.Runtime.Serialization
Object serialization is the process of reducing an object instance into a format that can be either stored to disk or transported over a network.
Related Posts
No comments :