ASP.Net
1. What are ASP.NET Web Forms? How is this technology different than what is available though ASP?
Web Forms are the heart and soul of ASP.NET. Web Forms are the User Interface (UI) elements that give your Web applications their look and feel. Web Forms are similar to Windows Forms in that they provide properties, methods, and events for the controls that are placed onto them. However, these UI elements render themselves in the appropriate markup language required by the request, e.g. HTML. If you use Microsoft Visual Studio® .NET, you will also get the familiar drag-and-drop interface used to create your UI for your Web application.
2. What are stages in ASP.Net Life cycles?
a. Object Initialization b. Load Viewstate Data c. Load Post data process postback data d. Object Load e. Raise Post back change events f. Process Client-Side post back events g. Prerender Object h. Viewstate saved i. Render to HTML j. Dispose
3. Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process ?
inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.
4. What’s the difference between Response.Write() andResponse.Output.Write()?
The latter one allows you to write formatted output.
5. Where does the Web page belong in the .NET Framework class hierarchy?
System.Web.UI.Page
6. Where do you store the information about the user’s locale?
System.Web.UI.Page.Culture
7. Suppose you want a certain ASP.NET function executed on MouseOver overa certain button. Where do you add an event handler?
Add function inside that property. So btnSubmit.Attributes.Add("onMouseOver","someClientCode();")
8. What data type does the RangeValidator control support?
Integer,String and Date
9. Should validation (did the user enter a real date) occur server-side or client-side? Why?
Client-side. This reduces an additional request to the server to validate the users input.
10. What does the "EnableViewState" property do? Why would I want it on or off?
It enables the viewstate on the page. It allows the page to save the users input on a form.
11. If I’m developing an application that must accommodate multiple security levels though secure login and my ASP.NET web application is spanned across three web-servers (using round-robin load balancing) what would be the best approach to maintain login-in state for the users?
Maintain the login state security through a database.
12. Describe the difference between inline and code behind.
Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.
13. Can you edit data in the Repeater control?
No, it just reads the information from its data source
14. Which template must you provide, in order to display data in a Repeater control?
ItemTemplate
15. Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines?
This is where you can set the specific variables for the Application and Session objects.
16. How can you provide an alternating color scheme in a Repeater control?
Use the AlternatingItemTemplate
17. What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?
You must set the DataSource property and call the DataBind method.
18. What tags do you need to add within the asp:datagrid tags to bind columns manually?
Set AutoGenerateColumns Property to false on the datagrid tag
19. What tag do you use to add a hyperlink column to the DataGrid?
20. Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?
DataTextField property
21. Which control would you use if you needed to make sure the values in two different controls matched?
CompareValidator Control
22. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?
Server.Transfer() : client is shown as it is on the requesting page only, but the all the content is of the requested page. Data can be persist accros the pages using Context.Item collection, which is one of the best way to transfer data from one page to another keeping the page state alive. Response.Dedirect() :client know the physical loation (page name and query string as well). Context.Items loses the persisitance when nevigate to destination page. In earlier versions of IIS, if we wanted to send a user to a new Web page, the only option we had was Response.Redirect. While this method does accomplish our goal, it has several important drawbacks. The biggest problem is that this method causes each page to be treated as a separate transaction. Besides making it difficult to maintain your transactional integrity, Response.Redirect introduces some additional headaches. First, it prevents good encapsulation of code. Second, you lose access to all of the properties in the Request object. Sure, there are workarounds, but they’re difficult. Finally, Response.Redirect necessitates a round trip to the client, which, on high-volume sites, causes scalability problems. As you might suspect, Server.Transfer fixes all of these problems. It does this by performing the transfer on the server without requiring a roundtrip to the client.
23. Expalin VB Script and Javascript
VBScript is the client side scripting (script which is executed in your browser). This script looks like VB and it is only supported by Internet Explorer. JavaScript is also another client side scripting based on Java. This script is supported by Internet Explorer and also Netscape browser
24. Describe the difference between inline and code behind - which is best in a loosely coupled solution?
Inline Versus Code-Behind Programming Models ASP.NET supports two modes of page development: Page logic code that is written inside blocks within an .aspx file and dynamically compiled the first time the page is requested on the server. Page logic code that is written within an external class that is compiled prior to deployment on a server and linked “behind” the .aspx file at run time.
25. Where would you use an iHTTPModule, and what are the limitations of anyapproach you might take in implementing one?
One of ASP.NET’s most useful features is the extensibility of the HTTP pipeline, the path that data takes between client and server. You can use them to extend your ASP.NET applications by adding pre- and post-processing to each HTTP request coming into your application. For example, if you wanted custom authentication facilities for your application, the best technique would be to intercept the request when it comes in and process the request in a custom HTTP module.
26. What method do you use to explicitly kill a user s session?
session.abandon
27. How do you turn off cookies for one page in your site?
cookie.discard
28. Can I still run ASP pages on a server that runs ASP.Net?
Yes. They will run side-by-side with no adverse affects to the ASP pages at all.
29.Define HTTP Module and HTTP Handler
Definition of HTTP Modules: HTTP modules are a logical replacement for ISAPI filters. Modules are a class that can participate in every web request. This is appropriate for code that should run on every request, such as caching, authentication or state management Definition of HTTP Handlers: HTTP Handlers provide the end point in the processing of a web request and are equivalent to ISAPI Extensions today. For example, many handlers can be involved in the request for an ASPX page, but only 1 handler is invoked. The handler runs after the HTTP modules have run. Which handler is invoked is determined by configuration settings in the config.web file. Handlers are assigned to handle requests based on the extension of the page requested.
30. Does ASP.Net still recognize the global.asa file?
ASP.Net does not recognize the standard ASP global.asa file. Instead it uses a file named global.asax with the same - plus additional - functionality.
31.Cache.insert(“MyDATa”,info,new cahcedependency(“server.mappath(“data.xml”)” What is the result of the code sample above?
The current contents in cache are stored into the file data.xml. The string "MyData" is inserted into cache when the file data.xml is created. The object referenced as info is removed from cache if the file data.xml is modified. The information contained in the file MyData is transferred into the file named data.xml as cache. A CacheDependency object is instantiated and the information is transferred to the data.xml file.
32.Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things. When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.
33.What’s a bubbled event?
When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.
34.What is the Global.asax used for?
The Global.asax (including the Global.asax.cs file) is used to implement application and session level events.
35.What is ViewState?
ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used the retain the state of server-side objects between postbacks.
36. What is the lifespan for items stored in ViewState?
Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page).
37. What are the different types of Session state management options available with ASP.NET?
ASP.NET provides In-Process and Out-of-Process state management. In-Process stores the session in memory on the web server. This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server. Out-of-Process Session state management stores data in an external data source. The external data source may be either a SQL Server or a State Server service. Out-of-Process state management requires that all objects stored in session are serializable.
38. What are some ways to manage state in an ASP.Net application?
A. Session objects, Application objects, ViewState, cookies, hidden form fields.