Net is a server side Technology to develop a web based applications.ASP.Net will make use of .Net framework features. Advantages of ASP.Net
y y y y
ASP.NET makes development simpler and easier to maintain with an event-driven, server-side programming model ASP.NET offers built-in security features through windows authentication or other authentication methods. Content and program logic are separated which reduces the inconveniences of program maintenance. Built-in caching features.
2. What are different stages of ASP.Net Page Life cycle? Each ASP.Net Web page performs following stages/events
y y y y y
Page Initialization (Page_Init event) Page Loading (Page_Load event) Page Prerender (Page_Prerender) Page Render (Page_Render) Page Unload (Page_Unload)
3. How do you validate Input data on web page? Before submitting a web page to server, Input validation on web page is one of the important task.ASP.Net provides below validation controls to validate data in web controls and shows user friendly Messages to the user. ASP.Net validation Controls 1. 2. 3. 4. 5. 6. Required field validator control Compare validator control Range Validator Control Regular Expression validator Control Validation Summary Custom validator
4. what are the different state management techniques in ASP.Net? Asp.Net state management can be maintained in two ways as below Client- Side State Management ASP.Net provides following techniques to store state information. This will improve application performance by minimizing server resource utilization 1.View state 2. Hidden Fields
Server Side State Management With respect to Server Side State Management ASP.Net uses Application state and Session state objects to store data or user state.
What are the differences between custom Web control and user control? Custom Web control is a control that inherits from web server control available in ASP.Net. A Custom Web Control could be compiled into separate .dll file. This custom Web control can be shared across all application by installing this dll in to Global Assembly Catch.User Control is a file (.ascx file) that contains a set of ASP.Net controls and code grouped together to provide common functionality across the application. User control can be used on different web pages of the application. Explain ASP.Net Catching? What are different catching mechanisms available in ASP.Net? ASP.Net catching one of the important performance factor for large web applications. ASP.Net Catching stores frequently accessed data in to catch object. There are two different types catching in ASP.Net 1.Application Catching 2.Page Output Catchin Explain the differences between Server-side and Client-side code? A. Server-side code executes on the server. Client-side code executes in the context of the clients' browser What does the "EnableViewState" property do? Why would I want it on or off? A. It allows page objects to save their state in a Base64 encoded string in the page HTML. One should only have it enabled when needed because it adds to the page size and can get fairly large for complex pages with many controls.
What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other? A. Server.Transfer transfers excution directly to another page. Response.Redirect sends a response to the client and directs the client (the browser) to load the new page (it causes a roundtrip). If you don't need to execute code on the client, Transfer is more efficient. How can I maintain Session state in a Web Farm or Web Garden? Use a State Server or SQL Server to store the session state.
What base class do all Web Forms inherit from? A. The Page class
Which WebForm Validator control would you use if you needed to make sure the values in two different WebForm controls matched? A. CompareValidator Control
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? A. You must set the DataSource property and call the DataBind method
Whats an assembly? Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of type implementations. To the runtime, a type does not exist outside the context of an assembly.
Describe the difference between inline and code behind - which is best in a loosely coupled solution? ASP.NET supports two modes of page development: Page logic code that is written inside <script runat=server> 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.
Which method do you invoke on the DataAdapter control to load your generated dataset with data? System.Data.Common.DataAdapter.Fill(System.Data.DataSet); If my DataAdapter is sqlDataAdapter and my DataSet is dsUsers then it is called this way: sqlDataAdapter.Fill(dsUsers); 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, this property instructs the client application not to save the Cookie on the users hard disk when a session ends.
What is Method Overriding? How to override a function in C#? An override method provides a new implementation of a member inherited from a base class. The method overridden by an override declaration is known as the overridden base method. The overridden base method must have the same signature as the override method. Use the override modifier to modify a method, a property, an indexer, or an event. You cannot override a non-virtual or static method. The overridden base method must be virtual, abstract, or override.
You can use the ADO.NET DataReader to retrieve a read-only, forward-only stream of data from a database. Using the DataReader can increase application performance and reduce system overhead because only one row at a time is ever in memory. After creating an instance of the Command object, you create a DataReader by calling Command.ExecuteReader to retrieve rows from a data source, as shown in the following example. SqlDataReader myReader = myCommand.ExecuteReader(); You use the Read method of the DataReader object to obtain a row from the results of the query. while (myReader.Read()) Console.WriteLine("\t{0}\t{1}", myReader.GetInt32(0), myReader.GetString(1)); myReader.Close(); The DataSet is a memory-resident representation of data that provides a consistent relational programming model regardless of the data source. It can be used with multiple and differing data sources, used with XML data, or used to manage data local to the application. The DataSet represents a complete set of data including related tables, constraints, and relationships among the tables. The methods and objects in a DataSet are consistent with those in the relational database model. The DataSet can also persist and reload its contents as XML and its schema as XML Schema definition language (XSD) schema. The DataAdapter serves as a bridge between a DataSet and a data source for retrieving and saving data. The DataAdapter provides this bridge by mapping Fill, which changes the data in the DataSet to match the data in the data source, and Update, which changes the data in the data source to match the data in the DataSet. If you are connecting to a Microsoft SQL Server database, you can increase overall performance by using the SqlDataAdapter along with its associated SqlCommand and SqlConnection. For other OLE DB-supported databases, use the DataAdapter with its associated OleDbCommand and OleDbConnection objects.
1.Whats the difference between Response.Write() andResponse.Output.Write()? Ans: Response.Output.Write() allows you to write formatted output. 2.What methods are fired during the page load? Ans: Init() - when the page is instantiated Load() - when the page is loaded into server memory PreRender() - the brief moment before the page is displayed to the user as HTML Unload() - when page finishes loading. 3. When during the page processing cycle is ViewState available? Ans: After the Init() and before the Page_Load(), or OnLoad() for a control. 4. What namespace does the Web page belong in the .NET Framework class hierarchy? Ans: System.Web.UI.Page 5. Where do you store the information about the users locale? Ans: System.Web.UI.Page.Culture 6. Whats a bubbled event? Ans: 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. 7. What data types do the RangeValidator control support? Ans. Integer, String, and Date.
Explain the Event Life cycle of ASP.NET 2.0? The events occur in the following sequence. Its best to turn on tracing(<% @Page Trace=true%>) and track the flow of events : PreInit This event represents the entry point of the page life cycle. If you need to change the Master page or theme programmatically, then this would be the event to do so. Dynamic controls are created in this event. Init Each control in the control collection is initialized. Init Complete* - Page is initialized and the process is completed. PreLoad* - This event is called before the loading of the page is completed. Load This event is raised for the Page and then all child controls. The controls properties and view state can be accessed at this stage. This event indicates that the controls have been fully loaded. LoadComplete* - This event signals indicates that the page has been loaded in the memory. It also marks the beginning of the rendering stage. PreRender If you need to make any final updates to the contents of the controls or the page, then use this event. It first fires for the page and then for all the controls. PreRenderComplete* - Is called to explicitly state that the PreRender phase is completed. SaveStateComplete* - In this event, the current state of the control is completely saved to the ViewState.
Unload This event is typically used for closing files and database connections. At times, it is also used for logging some wrap-up tasks.
y y
y y