Internet Information Services (IIS) Is Created by Microsoft To Provide Internet-Based Services To
Internet Information Services (IIS) Is Created by Microsoft To Provide Internet-Based Services To
.NET Framework is a complete environment that allows developers to develop, run, and deploy the following applications:
Console applications Windows Forms applications Windows Presentation Foundation (WPF) applications Web applications (ASP.NET applications) Web services Windows services Service-oriented applications using Windows Communication Foundation (WCF) Workflow-enabled applications using Windows Workflow Foundation (WF)
Assembly is physical grouping of logical units, Namespace, logically groups classes. Namespace can span multiple assembly.
Tuple is a fixed-size collection that can have elements of either same or different data types. Similar to arrays, a user must have to specify the size of a tuple at the time of declaration. Tuples are allowed to hold up from 1 to 8 elements and if there are more than 8 elements, then the 8th element can be defined as another tuple. Tuples can be specified as parameter or return type of a method.
Q.What is IIS? Why is it used?
Internet Information Services (IIS) is created by Microsoft to provide Internet-based services to ASP.NET Web applications. It makes your computer to work as a Web server and provides the functionality to develop and deploy Web applications on the server. IIS handles the request and response cycle on the Web server. It also offers the services of SMTP and FrontPage server extensions. The SMTP is used to send emails and use FrontPage server extensions to get the dynamic features of IIS, such as form handler.
Q.What is difference between System.String and System.StringBuilder classes?
String and StringBuilder classes are used to store string values but the difference in them is that String is immutable (read only) by nature, because a value once assigned to a String object cannot be changed after its creation. When the value in the String object is modified, a new object is created, in memory, with a new value assigned to the String object. StringBuilder class is mutable, as it occupies the same space even if you change the value. The StringBuilder class is more efficient where you have to perform a large amount of string manipulation.
Q.What is the difference between int and int32.
There is no difference between int and int32. System.Int32 is a .NET Class and int is an alias name forSystem.Int32.
Code access security (CAS) is part of the .NET security model that prevents unauthorized access of resources and operations, and restricts the code to perform particular tasks.
Q.What is the basic difference between ASP and ASP.NET?
The basic difference between ASP and ASP.NET is that ASP is interpreted; whereas, ASP.NET is compiled. This implies that since ASP uses VBScript; therefore, when an ASP page is executed, it is interpreted. On the other hand, ASP.NET uses .NET languages, such as C# and VB.NET, which are compiled to Microsoft Intermediate Language (MSIL).
Q.Which two new properties are added in ASP.NET 4.0 Page class?
The two new properties added in the Page class are MetaKeyword and MetaDescription. Q) What?s the difference between Response.Write() and Response.Output.Write()? Both Response.Write() and Response.Output.Write() are used to display output on the Screen. But Using Reponse.Output.Write() you can display formattable output while Response.Write() can only display single character line. Using Response.Output.Write() u can generate output according to ur own.mean text size. it is not possible with Response.Write() . Q)With respect to security ,which one is the better choice?.Net or J2EE? Explain. As per majority programmers .NET is the best one which have single vendor compare to ,the ease of use,more use friendly,you can send any problem ,it'll be solved. As per majority programmers .NET is the best one which have single vendor compare to ,the ease of use,more use friendly,you can send any problem ,it'll be solved. Q) What Is The Difference Between ViewState and SessionState? view state & session state are objects which are used for maintaining a state. but view state maintains a state in a single page.if we go to another page the state will be lossed. busession state we can maintain a state as long as browser opened or session time expired. Q) What is managed code and managed data managed code mean under control of CLR. Unmanaged code is not under control of CLR. code produced by (vb.net,c#,j#) .net framework language called managed code.its run under the CLR. garbage collector run automatically in managed code. code produced by third party language called unmanaged code.UC does not run under the clr. garbage collector will not run in case of unmanaged code. Q)How do you turn off cookies for one page in your site? Use the Cookie.Discard Property which Gets or sets the discard flag set by the server. When true, thisproperty instructs the client application not to save the Cookie on the user?s hard disk when a session ends.
it can be turned off by mentioning cookie state= false in web.config file You can mentioning cookie state= false in web.config file.This will turn off session cookie. Q) Advantages of VB.NET? 1. First of all, VB.NET provides managed code execution that runs under the Common Language Runtime (CLR), resulting in robust, stable and secure applications. All features of the .NET framework are readily available in VB.NET. 2. VB.NET is totally object oriented. This is a major addition that VB6 and other earlier releases didn't have. 3. The .NET framework comes with ADO.NET, which follows the disconnected paradigm, i.e. once the required records are fetched the connection no longer exists. It also retrieves the records that are expected to be accessed in the immediate future. This enhances Scalability of the application to a great extent. 4. VB.NET uses XML to transfer data between the various layers in the DNA Architecture i.e. data are passed as simple text strings. Q)Where on the Internet would you look for Web services? UDDI.org-Universal Description,Discovery Integration user define data interface.org
Q) What is partial classess in .net?
Partial classes allow us to divide the class definition into multiple files (physically). Logically, all the partial classes are treated as a single file by the compiler.
Q)What is Fragment Caching in ASP.NET?
Fragment caching refers to the caching of individual user controls within a Web Form. Each user control can have independent cache durations and implementations of how the caching behavior is to be applied. Fragment caching is useful when you need to cache only a subset of a page. Navigation bars, header, and footers are good candidates for fragment caching.
Server.Transfer
Transfers page processing from one page directly to the next page. No round-trip back to the client's browser. Faster response with lesser overhead on the server. Server.Transfer does not update the clients url history list or current url.
Response.Redirect
Used to redirect the user's browser to another page or site. Performs a trip back to the client where the client's browser is redirected to the new page. The user's browser history list is updated to reflect the new address.
Querystring is way to transfer information from one page to another through the URL. QueryString is attached to the URL with "?".
Advantages:
a. Supported by all the browsers b. No extra effort is needed to code. c. Easy to use.
Disadvantages: a.
All the attributes and values are visible to the end user. Therefore, they are not secure. b. There is a limit to URL length of 255 characters.
Q)What is ViewState? Explain its benefits and limitations.
Viewstate is used to maintain or retain values on postback. It helps in preserving a page. Viewstate is internally maintained as a hidden field in encrypted form along with a key.
Or
If a site happens to not maintain a ViewState, then if a user has entered some information in a large form with many input fields and the page is refreshes, then the values filled up in the form are lost. The same situation can also occur on submitting the form. If the validations return an error, the user has to refill the form. Thus, submitting a form clears up all form values as the site does not maintain any state called ViewState.
Advantages:
i) No server resources. ii) Viewstate ensures security because it stores the data in encrypted format. iii) Viewstates are simple. They are used by enabling or disabling the viewstate properties. iv) It is based on the wish of developer that they want to implement it at the page level or at control level.
Disadvantages:
i) If large amount of data is stored on the page, then page load might cause a problem. ii) Does not track across pages. Viewstate information does not automatically transfer from page to page.
Q.What is the lifespan for items stored in ViewState? The items stored in ViewState live until the lifetime of the current page expires including the postbacks to the same page. Q.What is the lifespan for items stored in ViewState? The items stored in ViewState live until the lifetime of the current page expires including the postbacks to the same page. Q)ASP.NET - Difference between src and Code-Behind. -
Src: is a way mention the name of the code-behind class to dynamically compile on the request for a page. Code-behind: is the logic written behind the UI design file. It specifies the name of the compiled file that contains the class. Code-behind attribute is only used for.Net.
Q)ASP.NET - What is the difference between URL and URI?
Uniform Resource Identifier: its a string and its responsibility is to identify a resource by metainformation. It gives information about only one resource.
URL - Uniform Resource Locator: identifies the resource on the net and tells it is obtainable using what protocols.
It is a process where things that can be handled before compilation are prepared in order to reduce the deployment time, response time, increase safety. Its main aim to boost performance. During development, it allows you to make changes to the web pages and reuse it using the same web browser to validate the changes without compiling the entire website There is a pre-defined folder structure for enabling the pre-compilation feature:
App_Code: stores classes App_Themes: stores CSS files, Images, etc. App_Data: stores XML files, Text Files, etc. App_GlobalResources: stores all the resources at global level E.g. resx files, etc App_LocalResources: stores all the resources at local/Page level
It's a way in CLR to maintain a boundary between various applications to ensure that they do not interfere in working of any other application. CLR acts as a mini operating system where a single process may have various application domains.
Application Domains keep an application separate. All objects created within the same application scope are created within the same application domain. Multiple application domains can exist in a single operating system process,
Q)What is ADO .NET and what is difference between ADO and ADO.NET?
ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.
Q)How ASP .NET different from ASP?
Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.
Q)What is ADO .NET and what is difference between ADO and ADO.NET?
ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where
in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.
Q)ASP.NET - Types of Caching
Page output:
Is used to fetch information or data at page level. It is best used when the site is mainly static. Used by declaring the output page directive
Page fragment:
Is used to cache the structure level information. It is used when parts of pages change. For example: user control Programmatic or data: Is used to fetch the information of an application quickly based on the requirements.
The ways to cache different versions on the same page using ASP.NET cache object is using OutputCache object. Three parameters of OutputCache, has 3 parameters:
VarByParam: based
on input parameters passed through HTTP POST/GET. VarByHeader: based on the page header content. VayByCustom: based on declaration of an attribute and overriding GetVaryByCustomString handler. VarByControl: varies with the value of properties of ASP objects.
Q)What is Scavenging?
A process where items are removed from cache in order to free the memory based on their priority. A property called "CacheItemPriority" is used to figure out the priority of each item inside the cache. This priority property is set when an item is added to the cache.
Q)What are the different types of Session state management options available with ASP.NET?
In-Process state management:
The In-Process type of Session state management stores the session in memory on the web server. In order to have a user always reconnect to the same web-server, a sticky server is needed.
Out-of-Process Session state management stores data in an external data source. The external data source may be a SQL Server or a State Server service. Out-of-Process state management requires the objects in a session to be serializable..
It is easy to implement. It ensures data durability, since session state retains data even if ASP.NET work process restarts as data in Session State is stored in other process space. It works in the multi-process configuration, thus ensures platform scalability.
Dis-Advantages
Since data in session state is stored in server memory, it is not advisable to use session state when working with large sum of data. Session state variable stays in memory until you destroy it, so too many variables in the memory effect performance.
Q)ASP.NET - Session, SessionId and Session State .
A session is the duration of connectivity between a client and a server application.
SessionId is used to identify request from the browser. By default, value of SessionId is stored in a cookie. You can configure the application to store SessionId in the URL for a "cookieless" session.
Q)What are the Session State Modes? Define each Session State mode supported by ASP.NET.
ASP.NET supports three Session State modes.
InProc Mode
This mode stores the session data in the ASP.NET worker process. This is the fastest among all of the storage modes. This mode effects performance if the amount of data to be stored is large. If ASP.NET worker process recycles or application domain restarts, the session state will be lost.
State Server mode
In this mode, the session state is serialized and stored in memory in a separate process. State Server can be maintained on a different system. State Server mode involves overhead since it requires serialization and de-serialization of objects. State Server mode is slower than InProc mode as this stores data in an external process.
SQL Server Mode
In this storage mode, the Session data is serialized and stored in a database table in the SQL Server database. This is reliable and secures storage of a session state. This mode can be used in the web farms. It involves overhead in serialization and de-serialization of the objects. SQL Server is more secure than the InProc or the State server mode.
Q)ASP.NET - What is a ViewState?
Viewstate is used to maintain or retain values on postback. It helps in preserving a page. Viewstate is internally maintained as a hidden field in encrypted form along with a key. Viewstate is the mechanism that automatically saves the values of the page's items just before rendering the page. It stores items added to a pages ViewState property as hidden fields on the page.
Advantages:
i) No server resources. ii) Viewstate ensures security because it stores the data in encrypted format. iii) Viewstates are simple. They are used by enabling or disabling the viewstate properties. iv) It is based on the wish of developer that they want to implement it at the page level or at control level.
Disadvantages:
i) If large amount of data is stored on the page, then page load might cause a problem. ii) Does not track across pages. Viewstate information does not automatically transfer from page to page.
Q)What is Cache Callback in Cache?
The cache object has dependencies e.g. relationships to the file it stores. Cache items remove the object when these dependencies change. As a work around we would
need to simply execute a callback method whenever items are removed from the cache to add the items back in cache.
e.g.: We have a string variable string var="hello" and store it in cache. This item would be removed from the cache if value is changed from "hello" to "bye". In such a case we need to simply right a callback function which would add updated var back in cache as its been removed as a result of its dependencies changing.
Q)Point to be noted about Application and Session state variables Application state variables
The data stored in these variables is available to all the users i.e. all the active sessions.
These are available to the single session who has created the variables. These variable can store any type of data. Maintaining Session state affects performance. Session state can be turned off at the application and page levels. Application state variables are available throughout the current process, but not across processes.
Q)What are benefits and limitations of using Cookies?
Advantages:
a. They are simple to use. b. Light in size, thus occupy less memory. c. Stores server information on client side d. Data need not to be sent back to server. e. Cookies persist for much longer period of time than a session.
Disadvantages:
a. Since they are stored on the client side in plain text, they are not secure. b. Number of cookies that can be stored and their size is limited. c. They don't work if security level is set too high in browser. d. Some people might just disable cookies on their browsers.
Q.Explain the cookie less session and its working.
ASP.NET manages the session state in the same process that processes the request and does not create a cookie. It is known as a cookie less session. If cookies are not available, a session is tracked by adding a session identifier to the URL. The cookie less session is enabled using the following code snippet:<sessionState
cookieless="true" />
Querystring is way to transfer information from one page to another through the URL. QueryString is attached to the URL with "?".
Advantages:
a. Supported by all the browsers b. No extra effort is needed to code. c. Easy to use.
Disadvantages:
a. All the attributes and values are visible to the end user. Therefore, they are not secure. b. There is a limit to URL length of 255 characters.
Absolute and sliding expiration are two Time based expiration strategies. Absolute Expiration: Cache in this case expires at a fixed specified date or time. Example: Cache. Insert("ABC", ds, null, DateTime.Now.AddMinutes(1), Cache.NoSlidingExpiration); The cache is set to expire exactly two minutes after the user has retrieved the data. Sliding Expiration: the cache duration increases in this case by the specified sliding expiration value every time the page is requested. More a page is requested it will remain in cache, whereas a less requested page will not remain in cache. Example: Cache.Insert("ABC", ds, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(1));
Q)What is Globalization and Localization in ASP.NET?
Localization is the process of adapting a software application for a specific locale. Globalization is the process of identifying the localizable resources of the application. You can provide support for Localization and Globalization to the application using System.Globalization, System.Resources and System.Threading namespaces. The developer can define culture specific information using the System.Globalization namespace. The System.Resources namespace contains ResourceManager class that allows access to resources either from the main assembly or from the Satellite Assemblies. The System.Threading namespace supports for multithreaded programming. A web form has two culture values, Culture and UICulture. Culture value is used for date and number formatting and UICulture values are used to determine culture specific resources. You can set culture and UICulture values in the application as follows Q)Explain the concepts and capabilities of cross page posting.
Cross Page Posting: It
refers to the scenario where on event of some controls posts from one page to another instead of a normal postback. Normal postback is when for e.g. a button (or any control that postbacks) is clicked and web page is submits the page back to itself which means a return trip. In Cross page posting, on click of a button there would be no return trip. Cross-page posting is done at the control level. It is possible to create a page that posts to different pages depending on what button the user clicks on. It is handled by done by changing the postbackurl property of the controls.
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.
Q.What is the difference between adding items into cache through the Add() method and through theInsert() method?
Both methods work in a similar way except that the Cache.Add() function returns an object that represents the item you added in the cache. The Cache.Insert() function can replace an existing item in the cache, which is not possible using the Cache.Add() method.
Q.What is AutoPostBack ?
If you want a control to postback automatically when an event is raised, you need to set the AutoPostBackproperty of the control to True. Q. Why do you use the App_Code folder in ASP.NET? The App_Code folder is automatically present in the project. It stores the files, such as classes, typed data set, text files, and reports. If this folder is not available in the application, you can add this folder. One of the important features of the App_Code folder is that only one dll is created for the complete folder, irrespective of how many files it contains.
Object pooling is a concept of storing a pool (group) of objects in memory that can be reused later as needed. Whenever, a new object is required to create, an object from the pool can be allocated for this request; thereby, minimizing the object creation. A pool can also refer to a group of connections and threads. Pooling, therefore, helps in minimizing the use of system resources, improves system scalability, and performance.
Q.What is connection pooling?
Connection pooling refers to the task of grouping database connections in cache to make them reusable because opening new connections every time to a database is a time-consuming process. Therefore, connection pooling enables you to reuse already existing and active database connections, whenever required, and increasing the performance of your application. You can enable or disable connection pooling in your application by setting the pooling property to either true or false in connection string. By default, it is enabled in an application.
Q. Out of Windows authentication and SQL Server authentication, which authentication is trusted
The Windows authentication technique is considered as a trusted authentication method because the username and password are checked with the Windows credentials stored in the Active Directory. The SQL Server Authentication technique is not trusted as all the values are verified by SQL Server only. .NET applications can use two different techniques to authenticate and connect with SQL Server. These techniques are as follows:
Q.What is the difference between the Clone() and Copy() methods of the DataSet class?
The Clone() method copies only the structure of a DataSet. The copied structure includes all the relation, constraint, and DataTable schemas used by the DataSet. The Clone() method does not copy the data, which is stored in the DataSet. The Copy() method copies the structure as well as the data stored in the DataSet.
Q.What are the various methods provided by the DataSet object to generate XML?
The various methods provided by the DataSet object to generate XML are:
ReadXml() - Reads XML document into a DataSet object. GetXml() - Returns a string containing an XML document. WriteXml() - Writes an XML data to disk.
.exe
1.These are outbound file.
2.Only one .exe file exists per application. 3. .Exe cannot be shared with other applications.
.dll
1.These are inbund file .
2.Many .dll files may exists in one application. 3. .dll can be shared with other applications. Q.Can a try block have more than one catch block? Yes, It can have as many as you want. It allows you to catch very specific exceptions. Q.Can a try block have nested try blocks? Yes perfectly legal, but not always it is useful. Q.How do you view the methods and members of a DLL? Go to visual studio 2003/2005 command prompt and type ildasm. It will open a window. In that window load ur dll, it will show all the methods and members.
Contains a number of classes that provide you with various methods and attributes to manage the communication between your application and data source. Enables you to access different data sources, such as Microsoft SQL Server, and XML, as per your requirements. Provides a rich set of features, such as connection and commands that can be used to develop robust and highly efficient data services in .NET applications.
The DataSet, which is disconnected from the data source and does not need to know where the data that it holds is retrieved from. The .net data provider, which allows you to connect your application to the data source and execute the SQL commands against it.
The data provider contains the Connection, Command, DataReader, and DataAdapter objects. TheConnection object provides connectivity to the database. The Command object provides access to database
commands to retrieve and manipulate data in a database. The DataReader object retrieves data from the database in the readonly and forward-only mode. The DataAdapter object uses Command objects to execute SQL commands. The DataAdapter object loads the DataSet object with data and also updates changes that you have made to the data in the DataSet object back to the database.
How many web.config files that can be there an ASP.NET application? more than one The RangeValidator control supports the following data types Can you inherit multiple interfaces? Date, Integer and String Yes
Q)Which of the following is incorrect about System.Text.StringBuilder and System.String? Strings are mutable in .Net Q)What is accessibility modifier protected internal? It is available to classes that are within the same assembly and derived from the specified base class. Q)What is the .NET collection class that allows an element to be accessed using a unique key?
Hash table
Q)How do you turn off SessionState in the web.config file?
In the system.web section of web.config, you should locate the httpmodule tag and you simply disable session by doing a remove tag with attribute name set to session. <httpModules> <remove name=Session /> </httpModules>
The Transfer method transfers from inside of one ASP page to another ASP page. Transfer passes the context information to the called page. The state information that has been created for an ASP page gets transferred to the other ASP page which comprises of objects and variables within an Application or Session scope, and all items in the Request collections.
Response.Redirect
The redirect message issues HTTP 304 to the browser and causes browser to go to the specified page. There is round trip between client and server. Redirect doesnt pass context information to the called page.
Server.Transfer
The browser is directly redirected to another page There is no round trip A Server transfer is possible within a website Information can be preserved in Server transfer through a parameter called preserveForm
Response.Redirect
The browser is requested to redirect to some other page through a message. There is a round trip. Response redirect is possible within two websites too. A state can be maintained in Response redirect but has a lot of drawbacks
Windows authentication. If windows authentication mode is selected for an ASP.NET application, then authentication also needs to be configured within IIS since it is provided by IIS. IIS provides a choice for four different authentication methods: Anonymous: IIS doesnt perform any authentication. All are allowed to access the ASP.NET application.
Passport authentication Passport authentication provides authentication using Microsofts passport service. If passport authentication is configured and users login using passport then the authentication duties are offloaded to the passport servers. Passport uses an encrypted cookie mechanism to indicate authenticated users. The passport users are considered authenticated while the rest are redirected to the passport servers to log in, after which they are redirected back to the site.
Q)Explain the use of static members with example using C#.NET.
Static members are not associated with a particular instance of any class. They need to be qualified with the class name to be called. Since they are not associated with object instances, they do not have access to non-static members. i.e.: "this" cannot be used, which represents the current object instance.
Q)What is serialization in .NET? What are the ways to control serialization?
Serialization is a process of taking an object and converting into a form so that it can be transported across the network.,The serialized data can also be stored at a location using de-serialization. The data contains the state of the object by which it can be reconstructed. Binary Serialization is a light and compact format. SOAP Serialization is used in web Services. XML Serialization provides custom serialization.
Q)What is an object pool in .NET?
It is a list of ready to use objects. Whenever a new request comes in for creating an object, then the application is served from this pool. This reduces the overhead of creating an object over and over again. An object pool is a container of objects that holds a list of other objects that are ready to be used.
Q)Can you override private virtual methods?
No, moreover, you cannot access private methods in inherited classes, have to be protected in the base class to allow any sort of access.
integrated query, set and other transformation operations. It extends VB, C# with their language syntax for queries. It also provides class libraries which allow a developer to take advantages of these features.
Q)Difference between the System.Array.CopyTo() and System.Array.Clone(). System.Array.CopyTo() performs a deep copy of the array System.Array.Clone() performs a shallow copy of the array Q)DIFFERENCE B/W STATIC VOID MAIN() & VOID MAIN()
using System; class Program { static void MethodA() { Console.WriteLine("Static method"); } void MethodB() { Console.WriteLine("Instance method"); } static char MethodC() { Console.WriteLine("Static method"); return 'C'; } char MethodD() { Console.WriteLine("Instance method"); return 'D'; } static void Main() { // // Call the two static methods on the Program type. // Program.MethodA(); Console.WriteLine(Program.MethodC()); // // Create a new Program instance and call the two instance methods. // Program programInstance = new Program(); programInstance.MethodB(); Console.WriteLine(programInstance.MethodD()); } } Output Static method Static method C Instance method Instance method D
Q)How to: Set the Culture and UI Culture for ASP.NET Web Page Globalization
The two culture settings do not have to have the same value. Depending on your application, it might be important to set them separately. An example is a Web auction site. The UICulture property might change for each Web browser, whereas the Culture stays constant. Therefore, prices are always displayed in the same currency and formatting. The Culture value can be set to specific cultures only, such as en-US or en-GB. This prevents the requirement to identify the correct currency symbol to use for en, where en-US and en-GB have different currency symbols.
Users can set the UI culture and culture in their browsers. For example, in Microsoft Internet Explorer, on the Tools menu, users can click Internet Options, on the General tab, click Language, and then set their language preference.
To set the UI culture and culture for all pages, add a globalization section to the Web.config file, and then set the uiculture and cultureattributes, as shown in the following example: <globalization uiculture="es" culture="es-MX" />
To set the UI culture and culture for an individual page, set the Culture and UICulture attributes of the @ Page directive, as shown in the following example: <%@ Page UICulture="es" Culture="es-MX" %>
__________________ directive informs the compiler of any custom server control added to the page. Register How do we identify that the page is Postback?
ispostbackproperty
___________ allows executing ASP.NET application level events and setting application-level variables. Global.asax file __________________ file apply settings to all ASP.NET applications machine.config
In case of _______________, there is a round trip and hence puts a load on server. response.redirect From performance point of view which is the fastest: Repeater Application_Disposed
________________event is fired just before an application is destroyed. How can we force all the validation control to run?
Page.Validate
Which one of the class contains the objects that we use to connect to a data source via an OLE-DB provider? System.Data.OLEDB Which method of command object doesnt return any row? Which type of caching is good if the website is fairly static? ExecuteNonQuery Page output caching
In which mode of storing ASP.NET session, session state is serialized and stored in a separate process.
State server
From which class global.asax file derived? Where do we store connection string in ASP.NET?
_________________object can hold more than one rowset from the same data source and the relationships between them. datasetobject ASP.NET doesnt run by itself, it runs inside the process of IIS
true
Which authentication method allows anyone to access the ASP.NET application and that IIS doesnt perform any authentication. Anonymous _________________ is verifying the identity of a user. Which one of the following has a parameter called as preserveForm?
authentication server.transfer
Q)What is Delegates?
A delegate in C# allows you to pass method of one class to objects of other class that can call these methods. OR A delegate is an object that holds the reference to a method. Delegates are like type safe function pointers. We need delegates as they can be used to write much more generic functions which are type safe also.
The delegates in .NET are like the pointers to the functions in C/C++. The difference is that these are type safe unlike the once in C/C++.
There are situations where in a programmer or an application needs to perform an action on a particular event. Eg: Some user action like click, text change, etc. So when these actions are performed by the user, the delegates invoke the respective functions.
Static constructor is used to initialize static data members as soon as the class is referenced first time, whereas an instance constructor is used to create an instance of that class with keyword. A static constructor does not take access modifiers or have parameters and can't access any non-static data member of a class
Q)Whats an abstract class?
A class that cannot be instantiated. A concept in C++ known as pure virtual method. A class that must be inherited and have the methods over-ridden. Essentially, its a blueprint for a class without any implementation.
Q) Is it namespace class or class namespace?
The .NET class library is organized into namespaces. Each namespace contains a functionally related group of classes so natural namespace comes first.
In the interface all methods must be abstract, in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes.
Q)Can you declare the override method static while the original method is non-static?
No, you cant, the signature of the virtual method must remain the same, only the keyword virtual is changed to keyword override.
Q)What is the difference between const and readonly in C#.NET?
The read only can be modified by the class it is contained in. However, the const cannot be modified. It needs to be instantiated only at the compile time.
C# Generic types are strong typed. C++ Templates are loosely typed. C# Generic types are instantiated at the runtime. C++ templates are instantiated at the compile time. C# Generic types do not permit the type parameters to have default values. C++ templates do.
C# generics are a simpler approach to parameterized types without the complexity of C++ templates In addition, C# does not attempt to provide all of the functionality that C++ templates provide. a. C# generics are more flexible than c++ templates. b. C# does not allow type parameters to have default types. c. Partial specialization is not supported by C# generics d. C# generics are simpler that C++ templates
Q)What are generics in C#.NET?
Generic types to maximize code reuse, type safety, and performance. They can be used to create collection classes. Generic collection classes in the System.Collections.Generic namespace should be used instead of classes such as ArrayList in the System.Collections namespace. Generics allow you to define type-safe data structures, without committing to actual data types. It allows writing less but more effective code. Generic provides flexibility and power but the developer needs to be responsible while using it.
Q)Whats the difference between struct and class in C#?
Structs cannot be inherited. Structs are passed by value, not by reference. Struct is stored on the stack, not the heap.
Q)Can you override private virtual methods?
No, moreover, you cannot access private methods in inherited classes, have to be protected in the base class to allow any sort of access.
___________________ allow to encapsulate discrete units of functionality and provide a graphical representation of that functionality to the user ans :: controls
A join is used to combine columns from two or more tables into a single result set. To join data from two tables you write the names of two tables in the FROM clause along with JOIN keyword and an ON phrase that specifies the join condition. The join condition indicates how two tables should be compared. In most cases they are compares on the base on the relationship of primary key of the first table and foreign key of the second table. In this article I will tell you about three important joins.
The JOIN keyword is used in a SQL statement to query data from two or more tables based on a relationship between certain columns in these tables.
1. 2.