Ans: ASP.NET was evolved in direct acknowledgment to the problems that developers had with standard ASP. Since ASP is in such wide use, Microsoft guaranteed that ASP scripts execute without modification on a machine with the .NET Framework (the ASP engine, ASP.DLL, is not modified when installing the .NET Framework). Thus, IIS can house both ASP and ASP.NET scripts on the same machine.
Ans: In plain words, XHTML is a stricter and cleaner version of HTML. XHTML stands for EXtensible Hypertext Markup Language and is a W3C Recommendation.
Yes, ASP.NET 2.0 Pages are XHTML compliant. However the facility has been given to the user to add the applicable document type declaration.
Ans: Viewstate stores the state of controls in HTML hidden fields. At times, this information can grow in capacity. This does affect the comprehensive responsiveness of the page, thereby affecting performance. The optimal size of a viewstate should be not more than 25-30% of the page size.
ViewState can be compressed to almost 50% of its size. .NET also provides the GZipStream orDeflateStream to compress viewstate
Ans: By setting the EnableViewStateMac to true in the @Page directive. This attribute checks the encoded and encrypted viewstate for tampering.
Ans: No. All source code files stored in the root App_Code folder must be in the same programming language. However, you can create two subfolders inside the App_Code and then add both C# and VB.NET in the respective subfolders. You also have to add configuration settings in the web.config for this to work.
Ans: Yes. You can complicate your code by using a new precompilation process called ‘precompilation for deployment’. You can use the aspnet_compiler.exe to precompile a site. This process builds each page in your web application into a single application DLL and some placeholder files. These files can then be deployed to the server.
You can also conclude the same task using Visual Studio 2005 by using the Build->Publish menu.
Ans: Yes. Each page can be written with a different programming language in the same application. You can create a few pages in C# and a few in VB.NET.
Ans: By using the Protected Configuration feature.
Ans: By default, ASP.NET submits a form to the same page. In cross-page posting, the form is submitted to a different page. This is done by setting the ‘PostBackUrl’ property of the button(that causes postback) to the desired page. In the code-behind of the page to which the form has been posted, use the ‘FindControl’method of the ‘PreviousPage’ property to reference the data of the control in the first page.
Ans: Yes. To change a master page, set the MasterPageFile property to point to the .master page during the PreInit page event.
Ans: ASP.NET configures IIS to deny access to any user that requests access to the Machine.config or Web.config files.
Ans: You can use the Web Site Administration Tool to configure remote websites.
Ans: You can keep multiple web.config files in an application. You can place a Web.config file inside a folder or wherever you need (apart from some exceptions) to override the configuration settings that are inherited from a configuration file located at a higher level in the hierarchy.
Ans: As quoted by Scott Hanselman, the short answer is that the latter gives you String.Format-style output and the former doesn't.
Ans: By specifying the theme in the web.config file.
< configuration > < system.web > < pages theme=”BlueMoon” /> </ system.web > </ configuration > |
Ans: To remove themes from your page, use the EnableTheming attribute of the Page directive.
Ans: The ASP.NET Wizard Control.
Ans: No. However it does support a dataset.
Ans: Yes. You can use ADSI, WMI, or COM interfaces to configure IIS programmatically.
Ans: Caching is one of the most interesting concept and operation in ASP.NET. If you can handle it, you can run any web application by applying the caching concept depending on the requirements.Caching is for providing solutions or the results to the users depending on their request, admin needs to recreate the pages often depending on user requests…STOP!!! "A cache simply stores the output generated by a page in the memory and this saved output (cache) will serve us (users) in the future.
Types
Ans: The Global.asax file, which is derived from the HttpApplication class, maintains a pool of HttpApplication objects, and assigns them to applications as needed. The Global.asax file contains the following events:
Ans: The AutoEventWireUp is a boolean attribute that allows automatic wireup of page events when this attribute is set to true on the page. It is set to True by default for a C# web form whereas it is set as False for VB.NET forms. Pages developed with Visual Studio .NET have this attribute set to false, and page events are individually tied to handlers.
Ans: ASP.NET invalidates the existing cache and assembles a new cache. Then ASP.NET automatically restarts the application to apply the changes.
Ans: Cookies are a State Management Technique that can store the values of control after a post-back. Cookies can store user-specific Information on the client's machine like when the user last visited your site. Cookies are also known by many names, such as HTTP Cookies, Browser Cookies, Web Cookies, Session Cookies and so on. Basically cookies are a small text file sent by the web server and saved by the Web Browser on the client's machine.
Ans: Code Behind refers to the code for an ASP.NET Web page that is written in a separate class file that can have the extension of .aspx.cs or .aspx.vb depending on the language used. Here the code is compiled into a separate class from which the .aspx file derives. You can write the code in a separate .cs or .vb code file for each .aspx page. One major point of Code Behind is that the code for all the Web pages is compiled into a DLL file that allows the web pages to be hosted free from any Inline Server Code.
Inline Code
Inline Code refers to the code that is written inside an ASP.NET Web Page that has an extension of .aspx. It allows the code to be written along with the HTML source code using a <Script> tag. It's major point is that since it's physically in the .aspx file it's deployed with the Web Form page whenever the Web Page is deployed.
Ans: When a page is requested by the user from the browser, the request goes through a series of steps and many things happen in the background to produce the output or send the response back to the client. The periods between the request and response of a page is called the "Page Life Cycle".
There are four stages that occur during the Page Life Cycle before the HTML Response is returned to the client. Later in this article we"ll study all these stages and their sub events.
Ans: The first main difference between session and caching is: a session is per-user based but caching is not per-user based, So what does that mean? Session data is stored at the user level but caching data is stored at the application level and shared by all the users. It means that it is simply session data that will be different for the various users for all the various users, session memory will be allocated differently on the server but for the caching only one memory will be allocated on the server and if one user modifies the data of the cache for all, the user data will be modified.
Ans: A Web Service is a software program that uses XML to exchange information with other software via common internet protocols. In a simple sense, Web Services are a way for interacting with objects over the Internet.
A web service is:
Ans: Localization means "process of translating resources for a specific culture", and Globalization means "process of designing applications that can adapt to different cultures".
.NET framework has greatly simplified the task of creating the applications targeting the clients of multiple cultures. The namespaces involved in creation of globalize, localizing applications are:
Q30. What is tracing in .NET?
Ans: Tracing helps to see the information of issues at the runtime of the application. By default Tracing is disabled.
Tracing has the following important features:
Tracing can be done with the following 2 types.