Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

1.

How to make a strong name assembly and register in GAC (all steps) Ans: Steps for Giving strong name to DLL Open .net command prompt. Go to the folder contanig DLL. Type sn -k test.snk, you can use any file name instead of test. This will create test .snk file in that folder. Open the assemblyinfo.cs file of project. Type file path in this tag [assembly:AssemblyKeyFile@"E:\hemant\practice\HP\bin\Debug\HP.snk") ] Build application, finally your strong name created for your DLL.

Steps for Installing in GAC After giving strong name in .net command prompt type gacutil in DLL path Copy the DLL file C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 folder. You can add references to another project using .net tab.

2. Explain about caching Ans: Caching is the process of storing frequently used data, usually data that is costly to generate, for reuse. Typically this data is stored in memory since retrieving data from memory is much more efficient than retrieving the data from other locations, such as a database. 3. Is there any difference in performance using Vb.net over c# Ans: The execution time for VB.NET and C# are similar, as the compiled application is build using the same framework. With that being said, you can get some performance gains with C# over VB.NET, using the C# ability to do Unsafe code. But for most applications the performance is the same. (Note: Using unsafe pointer arithmetic is much faster than using the usual pattern of for-loop/indexer..) 4. There is an un handled exception in page_load event , where we can handle these errors Ans: We can handle these kind of errors in the Global.asax file. (Can also called as application level error handling) 5. What for Custom Error Tag in web.config Ans: Depending on the circumstances, you might want to handle application errors in different ways. For example, at development time you probably want to see the detailed error pages that ASP.NET provides to help you identify and fix problems. However, once an application is being served in a production environment, you probably do not want to display detailed errors to your customer clients. 6. There is an unhandled exception ,handled in Page_Level, Application_Level and in CustomError tag , explain the sequence of firing

Ans: The actual order of error handling events is as follows. Page_Error of .aspx file or associated codebehind Application_Error in Global.ascx file CustomErrors section of the application configuration files (Web.config)

7. What Is the difference between Application_Start and Application_Init events Ans: Application_Start: Fired when the first instance of the HttpApplication class is created. It allows you to create objects that are accessible by all HttpApplication instances. ASP.NET calls start() once for the lifetime of the application domain, not for each HttpApplication instance. Application_Init: Fired when an application initializes or is first called. It is invoked for all HttpApplication object instances. Init() is Called once for every instance of the HttpApplication class after all modules have been created. 8. Differences between user control and Ans: User Control Easier to create Limited support for consumers who use a visual design tool A separate copy of the control is required in each application Cannot be added to the Toolbox in Visual Studio Good for static layout custom control Custom Control Harder to create Full visual design tool support for consumers Only a single copy of the control is required, in the global assembly cache Can be added to the Toolbox in Visual Studio Good for dynamic layout

9. There is a web server text box control and button control in a form, we implemented text changed and button click events , Explain the sequence of events in the post back Ans: Post back is generated when you click on button(In case of, textbox autopostback property is false) - Text_changed event fires - Button_click event fires Post back is generated twice(In case of, textbox autopostback property is True) - Text_changed event fires when text box control loses focus. - Button_click event fires when you click on button. 10. If disable view state, Does the text box will retain its value or not and explain the what will happen in post back events Ans: Yes

11. Different types of ASP.Net Authentication Ans: 3 types of authentication - Forms authentication - Passport authentication - Windows authentication 12. what is Web Service. Questions on performance ( caching concepts, why and how you would use it), have u ever developed a Web Service, etc Ans: A Web Service is programmable application logic accessible via standard Web protocols. One of these Web protocols is the Simple Object Access Protocol (SOAP). Caching is a technique where we can store frequently used data and Web pages are stored temporarily on local hard disks for later retrieval. This technique improves the access time when multiple users access a Web site simultaneously or a single user accesses a Web site multiple times. We can implement cache by adding namespace System.Web.Caching public sealed class Cache : IEnumerable This class cant be inherited. 13. What are the different authentications in Windows? Ans: 14. Whats the difference between Basic and Digest? Ans: With basic authentication, the client sends the username and password as cleartext. Security level is low(Medium using SSL/TLS.). With digest authentication, the client encrypts the username and password before sending the data over the network. Security level is medium. 15. Web Service Security. Ans: Web service security can be applied at three levels: Platform/transport-level (point-to-point) security Application-level (custom) security Message-level (end-to-end) security

16. ASP.NET Security, security authentication. Ans: ASP.NET implements additional authentication schemes using authentication providers, which are separate from and apply only after the IIS authentication schemes. ASP.NET supports the following authentication providers: Windows (default) Forms Passport None

To enable an authentication provider for an ASP.NET application, use the authentication element in either machine.config or Web.config as follows: <system.web>

<!-- mode=[Windows|Forms|Passport|None] --> <authentication mode="Windows" /> </system.web> 17. Custom Controls in terms both web and windows perspective. Ans:

http://msdn.microsoft.com/en-us/library/zt27tfhy.aspx
18. There is an application, the components are exposed through Web Service, using Web Service to get and send data. How you are going to increase the performance. Ans: In the .NET Framework, types have a concept of default values. For example, for any reference type the default value is null, and for an integer type it is zero. It is occasionally desirable to omit a data member from serialized data when it is set to its default value. Because the member has a default value, an actual value need not be serialized; this has a performance advantage. (Note: Consider WCF web services) 19. [web method].-- What is the attribute to write a web method? Ans: Attaching the WebMethod attribute to a Public method indicates that you want the method exposed as part of the XML Web service.

20. How to you VISIO. Ans: 21. Web Services.

Ans : A Web Service is programmable application logic accessible via standard Web protocols. Such as Http, Soap etc. they enable the communication between two applications using XML.
22. HTTP (GET-POST), SOAP etc. Ans: HTTP is a communications protocol that transports messages over a network. SOAP is a protocol to exchange XML-based messages that can use HTTP to transport those messages. In fact HTTP is the most common transport for SOAP messages. The HTTP-GET protocol and the HTTP-POST protocol These protocols encode request parameters as name-and-value pairs in the HTTP request. The HTTP-GET protocol and the HTTP-POST protocol provide backward compatibility in the following ways. The HTTP-GET protocol creates a query string of the name-and-value pairs and then appends the query string to the URL of the script on the server that handles the request. Therefore, you can mark the request. The HTTP-POST protocol passes the name-and-value pairs in the body of the HTTP request message. The SOAP protocol This protocol is an XML-based protocol that is intended to exchange structured information in a decentralized, distributed environment. Web services typically

use the SOAP protocol only for communications. Communications support for the HTTP-GET protocol and for the HTTP-POST protocol is more limited than for the SOAP protocol. 23. Advantages of web services. Ans: Web Services are supported on a wide range of platforms. Web services may extend its interface and add new methods without affecting the clients as long as they still provide the old methods and parameters. A client makes a request to a web service, the web service returns the result, and the connection is closed. There is no permanent connection. This makes it easy to scale up and support many clients at a time. Firewalls can pose a challenge for distributed object technologies. The only thing that almost always gets through firewalls is HTTP traffic on ports 80 and 443. Because web services use HTTP, they can pass through firewalls without explicit configuration.

24. Explain ASP.NET Page life cycle. Ans: Within each stage of the life cycle of a page, the page raises events that you can handle to run your own code. 1. PreInit 2. Init 3. Load 4. PreRender 5. Render 6. Unload

Page Event
PreInit

Typical Use
Raised after the start stage is complete and before the initialization stage begins. Use this event for the following: Check the IsPostBack property to determine whether this is the first time the page is being processed. The IsCallback and IsCrossPagePostBackproperties have also been set at this time. Create or re-create dynamic controls. Set a master page dynamically. Set the Theme property dynamically. Read or set profile property values.

Init

Raised after all controls have been initialized and any skin settings have been applied. The Init event of individual controls occurs before the Init event of the page.

Use this event to read or initialize control properties. Load The Page object calls the OnLoad method on the Page object, and then recursively does the same for each child control until the page and all controls are loaded. The Load event of individual controls occurs after the Load event of the page. Use the OnLoad event method to set properties in controls and to establish database connections. PreRender Raised after the Page object has created all controls that are required in order to render the page, including child controls of composite controls. (To do this, the Page object calls EnsureChildControls for each control and for the page.) The Page object raises the PreRender event on the Page object, and then recursively does the same for each child control. The PreRender event of individual controls occurs after the PreRender event of the page. Use the event to make final changes to the contents of the page or its controls before the rendering stage begins. Render This is not an event; instead, at this stage of processing, the Page object calls this method on each control. All ASP.NET Web server controls have aRender method that writes out the control's markup to send to the browser. If you create a custom control, you typically override this method to output the control's markup. However, if your custom control incorporates only standard ASP.NET Web server controls and no custom markup, you do not need to override the Render method. For more information, see Developing Custom ASP.NET Server Controls. A user control (an .ascx file) automatically incorporates rendering, so you do not need to explicitly render the control in code. Unload Raised for each control and then for the page. In controls, use this event to do final cleanup for specific controls, such as closing control-specific database connections. For the page itself, use this event to do final cleanup work, such as closing open files and database connections, or finishing up logging or other request-specific tasks.

25. Have you created data base on the .NET project. Ans: Yes, I used SQL Server database on the .net project.

26. What modeling tools you have used before?, exampleUML Ans: I have used Microsoft Visio, Rational Rose 27. What is the base of UML Use case Class Diagram? Ans: Unified Modeling Language (UML) is a standardized general-purpose modeling language in the field of object-oriented software engineering. Use case is a list of steps, typically defining interactions between a role (known in UML as an "actor") and a system, to achieve a goal. The actor can be a human or an external system. class diagram in the Unified Modeling Language (UML) is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, operations (or methods), and the relationships among the classes. 28. What is there in class diagram in UML class name, class attribute Ans: classes, their attributes, operations (or methods), and the relationships among the classes. In the class diagram these classes are represented with boxes which contain three parts: The upper part holds the name of the class The middle part contains the attributes of the class The bottom part gives the methods or operations the class can take or undertake 29. Write a code to subtract Days in ASP.NET. Ans : DateTime start = new DateTime(2009, 6, 14); DateTime end = new DateTime(2009, 12, 14); TimeSpan difference = end - start; 30. What are the scripting languages available for WEB, What is your preference and why? Ans: Javascript, jquery, CSS, CGI, VB script Jquery is the best scripting language for web because most of the browsers support jquery. 31. When, why do you use Global.asax. The Global.asax file provides a way to respond to application or module level events in one central location. You can use this file to implement application security, as well as other tasks. 32. ASP.Net : Static Methods How to access Errors if accessed with an instance 33. What is Windows authentication?
In ASP.NET authentication is done by both IIS and ASP.NET. ASP.NET implements authentication through authentication providers that contains the code necessary to authenticate the requestor's credentials. There are three types of authentication providers built into ASP.NET. They are:

1. 2. 3.

Windows Authentication Provider. Forms Authentication Provider. Passport Authentication Provider.

Windows Authentication Provider: Provides information on how to use Windows authentication in conjunction with Microsoft Internet Information Services (IIS) authentication to secure ASP.NET applications. Why Windows Authentication:

1. Windows authentication is generally used if the users accessing the application belong to same organization. 2. This authentication method uses Windows accounts for validating users' credentials. This type of authentication is very good for intranet Web sites where we know our users. 34. How would you write forms authentication?
Configure the Security Settings in the Web.config File
This section demonstrates how to add and modify the <authentication> and <authorization> configuration sections to configure the ASP.NET application to use forms-based authentication. In Solution Explorer, open the Web.config file. Change the authentication mode to Forms. Insert the <Forms> tag, and fill the appropriate attributes. (For more information about these attributes, refer to the MSDN documentation or the QuickStart documentation that is listed in theREFERENCES section.) Copy the following code, and then click Paste as HTML on the Edit menu to paste the code in the <authentication> section of the file:

<authentication mode="Forms"> <forms name=".ASPXFORMSDEMO" loginUrl="logon.aspx" protection="All" path="/" timeout="30" /> </authentication>
Deny access to the anonymous user in the <authorization> section as follows:

<authorization> <deny users ="?" /> <allow users = "*" /> </authorization>
Create a Sample Database Table to Store Users Details
This section demonstrates how to create a sample database to store the user name, password, and role for the users. You need the role column if you want to store user roles in the database and implement role-based security. On the Start menu, click Run, and then type notepad to open Notepad. Highlight the following SQL script code, right-click the code, and then click Copy. In Notepad, clickPaste on the Edit menu to paste the following code Save the file as Users.sql. On the Microsoft SQL Server computer, open Users.sql in Query Analyzer. From the list of databases, click pubs, and run the script. This creates a sample users table and populates the table in the Pubs database to be used with this sample application.

Create a Logon.aspx Page


Add a new Web Form to the project named Logon.aspx. Open the Logon.aspx page in the editor, and switch to HTML view. Copy the following code, and use the Paste as HTML option on the Edit menu to insert the code between the <form> tags: This Web Form is used to present a logon form to users so that they can provide their user name and password to log on to the application. Switch to Design view, and save the page.

Code the Event Handler So That It Validates the User Credentials


This section presents the code that is placed in the code-behind page (Logon.aspx.cs). Double-click Logon to open the Logon.aspx.cs file. Import the required namespaces in the code-behind file: Create a ValidateUser function to validate the user credentials by looking in the database. (Make sure that you change the Connection string to point to your database). You can use one of two methods to generate the forms authentication cookie and redirect the user to an appropriate page in the cmdLogin_ServerClick event. Sample code is provided for both scenarios. Use either of them according to your requirement. Call the RedirectFromLoginPage method to automatically generate the forms authentication cookie and redirect the user to an appropriate page in the cmdLogin_ServerClick event: Generate the authentication ticket, encrypt it, create a cookie, add it to the response, and redirect the user. This gives you more control in how you create the cookie. You can also include custom data along with the FormsAuthenticationTicket in this case. Make sure that the following code is added to the InitializeComponent method in the code that the Web Form Designer generates:

Create a Default.aspx Page


This section creates a test page to which users are redirected after they authenticate. If users browse to this page without first logging on to the application, they are redirected to the logon page. Rename the existing WebForm1.aspx page as Default.aspx, and open it in the editor. Switch to HTML view, and copy the following code between the <form> tags:

<input type="submit" Value="SignOut" runat="server" id="cmdSignOut">


This button is used to log off the forms authentication session. Switch to Design view, and save the page. Import the required namespaces in the code-behind file:

using System.Web.Security;
Double-click SignOut to open the code-behind page (Default.aspx.cs), and copy the following code in the cmdSignOut_ServerClick event handler:

private void cmdSignOut_ServerClick(object sender, System.EventArgs e) { FormsAuthentication.SignOut(); Response.Redirect("logon.aspx", true); }


Make sure that the following code is added to the InitializeComponent method in the code that the Web Form Designer generates:

this.cmdSignOut.ServerClick += new System.EventHandler(this.cmdSignOut_ServerClick);


Save and compile the project. You can now use the application.

35. What is a web control, how would you use it? 36. What is the difference between User Control and Custom Control, how would you use them?

Custom Control A loosly coupled control w.r.t code and UI Derives from Control Defines UI in the ResourceDictionary UI can be skinable Has Dynamic layout UI can be changed in different project

User Control A tightly coupled control w.r.t code and UI Derives from UserControl Defines UI as a normal XAML Child controls can skinable only Has static layout UI is fixed and can't have different look in every project Has full toolbox support Can't be added to the toolbox Defines a single control Defines a set of controls More flexible Not much flexible like Custom Control Requires in depth knowledge of Silverlight UI Model Does not require depth knowledge of UI Model
When to use?
Good question "When to use a Custom Control?" Didn't you get the inner meaning of it yet? Ok, read the below summarized points:

When you have a rapid and fixed content in your UI, use UserControl. When you want to separate some basic functionality of your main view to some smaller pieces with reusability, use UserControl for that. When you want to use your control in different projects and each project may want to change the look according to their need, use CustomControl. When you want to implement some additional functionality of a Control, create a CustomControl derived from the base control. When you want to apply theme to your control, use CustomControl. When you want to add toolbox support for your control, so that, your user will be able to do drag and drop to the designer, in such case, use CustomControl.

37. What are the various Request Objects in ASP?


The Request object retrieves the values that the client browser passed to the server during an HTTP request. It is used to get information from the user. Using this object, you can dynamically create web pages and perform various server-side actions based on input from the user. The syntax, collections, properties and methods of the ASP Request object are as follows: Syntax Request[.collection|property|method](variable) Collections Collections ClientCertificate Description The ClientCertificate collection provides access to the certification fields from a request issued by the web browser. Commonly, it is used when the client is requesting secure pages through SSL connection. Before using this collection, you must configure your Web server to request client certificates. The Cookies collection allows you to retrieve the values of the cookies sent in an HTTP request. The Form collection allows you to retrieve the data input into an HTML form posted to the HTTP request body by a form using the POST method. The QueryString collection allows you to retrieve the values of the variables in the HTTP query string. For example, it parses the values sent by a form using the GET Method. The QueryString collection is less capable than the Form collection, since there is a limit to the amount of data that can be sent in the header of an HTTP request. The ServerVariables collection contains the values of predefined environment variables plus all of the HTTP header values sent from the client browser to the web server. Description The TotalBytes property is a read-only property that specifies the total number of bytes sent by the client in the HTTP request body. It is important when preparing to read data from the request body using the BinaryRead method of the Request object. Description The BinaryRead method retrieves the data sent to the server from the client as part of a POST request and stores it in a SafeArray. A SafeArray is a special variant array that contains, in addition to its items, the number of dimensions in the array and the upper bounds of the array.

Cookies Form QueryString

ServerVariables

Properties Properties TotalBytes

Methods Methods BinaryRead

38. Difference between ASP and ASP.NET? 39. What is the difference between Respose.Rediect and Server.Transfer?
Response.Redirect should be used when: we want to redirect the request to some plain HTML pages on our server or to some other web server we don't care about causing additional roundtrips to the server on each request we do not need to preserve Query String and Form Variables from the original request we want our users to be able to see the new redirected URL where he is redirected in his browser (and be able to bookmark it if its necessary) Server.Transfer should be used when: we want to transfer current page request to another .aspx page on the same server we want to preserve server resources and avoid the unnecessary roundtrips to the server we want to preserve Query String and Form Variables (optionally) we don't need to show the real URL where we redirected the request in the users Web Browser

Response.Redirect involves a roundtrip to the server whereas Server.Transfer conserves server resources by avoiding the roundtrip. It just changes the focus of the webserver to a different page and transfers the page processing to a different page. Response.Redirect can be used for both .aspx and html pages whereas Server.Transfer can be used only for .aspx pages. Response.Redirect can be used to redirect a user to an external websites. Server.Transfer can be used only on sites running on the same server. You cannot use Server.Transfer to redirect the user to a page running on a different server Response.Redirect changes the url in the browser. So they can be bookmarked. Whereas Server.Transfer retains the original url in the browser. It just replaces the contents of the previous page with the new one.

40. Explain Page Life cycle?


General Page Life Cycle Stages each and every time the browser sends the request, page instance is created. HTTP runtime invokes ProcessRequest and starts page execution. Table Showing Stage and Corresponding Events

Stage Initialization of the page Loading of the View State Processing of the Postback data Loading of Page Notification of PostBack Handling of PostBack Event Pre Rendering of Page Saving of view state Rendering of Page Unloading of the Page

Events/Method

Page_Init LoadViewState LoadPostData Page_Load RaisePostDataChangedEvent RaisePostBackEvent Page_PreRender SaveViewState Page_Render Page_UnLoad

Setting Up Of the Page


ASP.NET determines that the page request by a user requires to be parsing and compiling or to render cached copy of the page to be sent. Thus it comes very much before the beginning of the page life cycle. After this, it is also checked that request is a normal request, postback, crosspage postback or callback. The page constructor creates a tree of controls as soon as the HTTP runtime instantiates the page class to perform the request.

Events

PreInit This event is the beginning of the page life cycle. All page controls are initialized and the properties are set according to the aspx source code.

Possible to change or set Master page, themes Creates or re-creates dynamic controls Reads or sets Profile property values
Init First, the on the

Init event for the Page object occurs, then Init Page. Viewstate information is not available at this stage.

event occurs for each control

Controls have been initialized Theme skins applied if any Initialize control properties
InitComplete This event is used for processing tasks that require all initialization to be complete.

PreLoad This event is used before performing any processing that should occur before event if you need to perform processing on your page or control before the the

Load. Use this Load event. Before

Page

instance raises this event, it loads view state for itself and all controls, and then

processes any postback data included with the Requestinstance. Load Set properties in controls and establish database connections. Control Events These are control specific events such as Button Click, DropDownIndexChanged, etc. Load Complete This event is used for performing those tasks which require load has been completed. PreRender In this event, Page ensures that all child controls are created. Page calls EnsureChildControls for all controls, including itself. Every control whose datasource/databind property is set calls for its databind method. SaveStateComplete This event occurs after viewstate is encoded and saved for the page and for all controls. Render Every ASP.NET control has render method and the page instance calls this method to output the controls markup, after this event any changes to the page or controls are ignored. Unload Unload event is used to do cleanup tasks like closing the database connections, closing of the open files, completing logging or other requested tasks. Unload events occurs for each control on page control tree first and after that page.

41. What are Data Grid, Data List, and Repeater, how they are different? Ans : Datagrid An big advantage of the datagrid is that it is very simple to use and easily customizable with some cool color settings for borders,backgrounds etc. It also supports paging and sorting which also is accompanied by some customizable features for example, the way the page index can be displayed, as numbers or previous and next links etc. However, the DataGrids built-in paging capabilities are horrible in terms of performance. Its built-in paging grabs all the rows from the database with each call and then only displays the necessary records. For any real-world application, you will need to turn off the built-in paging and create your own custom paging. ( refer to letting AllowCustomPaging property to true and manually implement the function in your own code). In term of displaying information, Datagrid is not flexible as Repeater (CSS). The ASP.NET DataGrid requires the ViewState for its sorting capabilities. So, unless you want all the viewstate data to decrease the performance of your application, you will have to turn off its built-in sorting and create your own sorting methodology.

DataList Like DataGrid, it render content within HTML tag like <table> or <span> but it dose not use specified columns (DataGridColumn base class) to display items but use template like Repeater. The outcome is that you can mix up HTML content and databinding syntax.

DataList dose not support paging and sorting unless you give some effort on implementing these functions. Again hing level of customization with rendered HTML mark up is the reason why one might prefer DataList over DataGrid. Repeater A Repeater is designed to let the user customize its output and thus have complete control over what is being rendered. An important thing to remember about the Repeater is that, it is not derived from the WebControl class, like the DataGrid and DataList due to which it lacks the stylistic properties common to both the DataGrid and DataList. So if you want to make things look pretty in a repeater, write it yoursel. Among all the 3 web controls in question, Repeater offers the best performance, though only slightly ahead of the datalist but beating datagrid by a considerable margin.

42. VSS. Ans : Visual studio safe. 43. Difference between the GET and POST method?
In GET method - data is submitted as a part of url - data is visible to the user - We can bookmark link with this method - Server can log all action - because of server log, we can pass 255 char. as query string - it is not secure but fast and quick In POST method - data is submitted as a part of http request - data is not visible in the url - We cannot bookmark page link - We can pass unlimited data by this method as query string - it is more secure but slower as compared to GET

44. Whats the session time out of .NET application (default)? 20mins 45. Various questions on HTML and web server controls, validators? 46. How different is ASP.NET is managing Session State 47. Why we need OutProc Sessions Ans :By using inproc, if the web server\application is restarted, all existing session data will be lost. If you are deploying application in web garden/web farm scenario, inproc doesnt work. Since we don't know to which server web requests get routed, common sql or state server is choosen. 48. Where the sessions will be stored in DB Ans :

49. Explain in detail about storing sessions in state server 50. Ans : This is also called Out-Proc session mode. StateServer uses a standalone Windows Service which is independent of IIS and can also be run on a separate server. This session state is totally managed by aspnet_state.exe. This server may run on the same system, but it's outside of the main application domain where your web application is running. This means if you restart your ASP.NET process, your session data will still be alive. This approaches has several disadvantages due to the overhead of the serialization and de-serialization involved, it also increases the cost of data access because every time the user retrieves session data, our application hits a different process. More on session.. visit http://www.codeproject.com/Articles/32545/Exploring-Session-in-ASP-Net

51. Explain about ASP.NET deployment Ans : Deployment is the process of distributing a completed application or component to be installed on other computers. Microsoft ASP.NET is designed to make Web application deployment easy. To that purpose, it includes the following features. When a newer version of a Web.config, .aspx, .asmx, or any other ASP.NET file is copied to an existing Web application, ASP.NET detects that the file has been updated. It then loads a new version of the Web application to handle all new requests, while allowing the original instance of the Web application to finish responding to any current requests. When all requests have been satisfied for the original application, it is automatically removed This feature eliminates downtime while Web applications are being updated. All ASP.NET application configuration settings are stored in a Web.config file, an XML-based text file stored in the application root directory, for easy deployment of application settings. If you modify these settings when the application is running, ASP.NET automatically detects the changes, reapplies all the settings, and recompiles the application for you.

52. Differences between ASP.NET 40./3.5/2.0/1.1 53. what is the difference between DBNull , Nothing and empty Ans : Null tells that there is nothing as the reference to an object DBNull.Value is a value type (used as a database can return an empty value and then returns that type). 54. What is the difference between or and or else 55. What is the difference between or and or else 56. Explain about ViewState Ans : ViewState persist the values of controls of particular page in the client

when post back operation done. When user requests another page previous page data no longer available.Viewstate maintains the info in the form of hiddel fields.
57. Different types of Bug Tracking tools used Ans :

58. Difference between Dataset and Data reader Ans : Dataset is disconnected component and stores in the info in Client systems virtual memory and in the form of xml. Where is Data reader is connected component provides read only forward only access to the data in db. 59. How to get the row count for a Dataset table Ans : ds.tables[tableindex].rows.count 60. Where the assemblies reside in ASP.NET application Ans : in bin folder of web application root fooder. 61. Diffrences between ASP & ASP.NET Ans: ASP.NET ASP.Net web forms have a code behind file which contains all event handling code. ASP.Net web forms inherit the class written in code behind. ASP.Net web forms use full fledged programming language ASP.Net web applications are configurable (web.config) ASP.Net webforms can use custom controls through the @ register directive ASP.Net web forms have ADO.Net which supports XML integration and integration of data from two or more data sources ASP ASP does not have such facility to separate programming logic from design. ASP does not have the concept of inheritance. ASP pages use scripting language. ASP applications are not. It is not available with ASP.

while ASP has ADO which is a simple COM object with limited facilities.

62. Explain about httpcontext object Ans: Encapsulates all HTTP-specific information about an individual HTTP request. The HttpContext object in the System.Web namespace encapsulates all of the information related to one request and allows you to access that information within or outside of the actual aspx page that is being processed. 63. Explain about worker process Ans: The "Process" which is responsible for processing Asp.net application request and sending back response to the client , is known as "Worker Process". All ASP.NET functionalities runs within the scope of this process. 64. Explain about virtual Directory Ans: A virtual directory represents a web application and it points to a physical folder in your computer. A web application is accessed using a virtual directory name instead of a physical folder name. For example, if you have a web application called "Shopcart" in your machine, you will have a virtual directory for this web application. You will access

your web application using the URL httP://localhost/Shopcart. If your virtual directory name is "Test", then your web application url will be "http://localhost/Test". 65. about Web.config Ans: often use the Web.config file not only for securing your application but also for wide range of other purposes which it is intended for. ASP.NET Web.config file provides you a flexible way to handle all your requirements at the application level. ASP.NET Web.config allows you to define or revise the configuration settings at the time of developing the application or at the time of deployment or even after deployment. The following are brief points that can be understood about the Web.config file: Web.config files are stored in XML format which makes us easier to work with. You can have any number of Web.config files for an application. Each Web.config applies settings to its own directory and all the child directories below it. All the Web.config files inherit the root Web.config file available at the following location systemroot\Microsoft.NET\Framework\versionNumber\CONFIG\Web.config location IIS is configured in such a way that it prevents the Web.config file access from the browser. The changes in Web.config dont require the reboot of the web server. 66. what is third normal form Ans: Third normal form is the form that most well-designed databases meet. 3NF extends 2NF to include the elimination of transitive dependencies. Transitive dependencies are dependencies that arise from a non-key attribute relying on another non-key attribute that relies on the primary key. In other words, if there is an attribute that doesn't rely on the primary key but does rely on another attribute, then the first attribute has a transitive dependency. 67. Asp.net authentication Ans: Authentication is any process

by which you verify that someone is who they

claim they are.

68. Forms authentication in detail Ans : Forms authentication lets you authenticate users by using your own code and then maintain an authentication token in a cookie or in the page URL. Forms authentication participates in the ASP.NET page life cycle through the FormsAuthenticationModule class. You can access forms authentication information and capabilities through the Forms Authentication class. To use forms authentication, you create a login page that collects credentials from the user and that includes code to authenticate the credentials. Typically you

configure the application to redirect requests to the login page when users try to access a protected resource, such as a page that requires authentication. If the user's credentials are valid, you can call methods of the FormsAuthentication class to redirect the request back to the originally requested resource with an appropriate authentication ticket (cookie). If you do not want the redirection, you can just get the forms authentication cookie or set it. On subsequent requests, the user's browser passes the authentication cookie with the request, which then bypasses the login page.

69. Authorisation in Forms authentication 70. Current role in project 71. what is data adapter and data reader? How do you use them? Give coding examples Ans : Data adaptor is used in retrieving the data from db in disconnected mode.It retrieves data from the database and attach the resultset to dataset or datatable.But datareader also used to retrieve the data from db. DataReader : This is best used when you just want to fetch data in readony mode , populate your business entity and close the reader. This is really fast. DataAdapter : You can Read/Update the data with dataadapters but it is less faster when reading the data then Datareader.

You can update the data with DataAdapter but with reader you won't
72. Give me examples on when do you use Data reader and when do you use data adapter. 73. What is indexeing? What is cluster and unclustered indexes? When do you each one? Give example. 74. What are the joins do you know, explain in details, give examples on joins? 75. What is refrential integrity, how is this being used with tables? 76. What are deadlocks? Ans : In general, deadlock means that two or more entities are blocking some

sources, and none of them is able to finish, because they are blocking sources in a cyclic way.
77. What are the levels of Isolation? Explain all. Elaborate more on serializable level. 78. How many clustered index in a table? How many can an unclustered index we can create Ans : We can create only one clustered indexes per table. We can create 999 non clustered indexes in sql server 2008. 79. About checked statement Ans : The checked keyword is used to control the overflow-checking context for

integral-type arithmetic operations and conversions. It can be used as an operator or a statement.


80. Diff Between ADO and ADO.net Ans :

1. ADO used connected data usage, while ADO.net used disconnected data environment. 2. ADO used oledb to access data and is COM-based, while ADO.net uses XML

as the format for transmitting data to and from your database and web application. 3. In ADO, Record set, is like a single table or query result, while in ADO.net Dataset, can contain multiple tables from any datasource. 4. In ADO, it is sometime problematic because firewall prohibits many types of request, while in ADO.net there is no such problem because XML is completely firewall-proof.
81. What is Normalization? Ans : Refer Sql. 82. Role in the latest project 83. What is a strong key? Ans : A strong name consists of the assembly's identityits simple text name, version number, and culture information (if provided) plus a public key and a digital signature. It is generated from an assembly file (the file that contains the assembly manifest, which in turn contains the names and hashes of all the files that make up the assembly), using the corresponding private key. Visual Studio can assign strong names to an assembly. Assemblies with the same strong name are expected to be identical. 84. What is CLR? Ans :CLR is runtime for entire .net framework.It provides execution support for .net fw code execution. 85. Questions about each role in the project 86. Explain doing transactions in to two databases using ADO.NET ? Ans : refer http://www.codeproject.com/Articles/10223/Using-Transactions-in-ADO-NET 87. What is Diffgram , Where we can use it? Ans : The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. A good use is reading database data to an XML file to be sent to a Web Service. 88. How to create persistent cookies? Ans : HttpCookie myCookie = new HttpCookie("myCookie"); //Add key-values in the cookie myCookie.Values.Add("userid", objUser.id.ToString()); //set cookie expiry date-time. Made it to last for next 12 hours. myCookie.Expires = DateTime.Now.AddHours(12); //Most important, write the cookie to client. Response.Cookies.Add(myCookie);

You might also like