Sunday, April 29, 2012

ASP.NET

Page Life Cycle :-
1. Initialization (on init) : the server create an instance of the server control.
2. Load Control State
3. Load View State : the view state of the control posted by the client is reloaded.
4. Load (on load) : instance of the control loaded into the page.
5. PreRender : this prepares the control for rendering.
6. Save Control State
7. Save View State
8. Render : the server creates the corresponding tag for the control.
9. Dispose : all cleanup tasks, such closing files and database connection opened by control.
10. Unload : all cleanup tasks, such as destroying the instances of the server control are performed.

Master Page Life Cycle :-
1. Master page child controls initialization
2. Content page child controls initialization
3. Master page initialization
4. Child page initialization.
5. Content page load
6. Master page load.
7. Master page child controls load.
8. Content page child controls load.

Authentication :- Verifying the identity of the user.

Authorization :- Identity has access rights to the system.

Impersonation :- With impersonation, asp.net can execute the request using the identity of the client who is making the request.

Force all validation control to run :- Page.Validate()

Kill a user session :- Session.Abandon

IIS Isolation levels :-
1. Low (IIS Process) :- IIS process and asp.net application run in same process.
2. Medium (Pooled) :- IIS process isolated from web application.
3. High (Isolated) :- IIS process and all application are isolated.

Sign out from authorization :- FormsAuthentication.SignOut()

Web Farm vs Web Garden :-
Web Farm,
It consists of two or more web server of same configuration. When any request comes there is a switching/routing logic which decides which web server handles the request.
Fig. Web Farm
Web Garden,
A model in which multiple processes run on multiple CPU in a single server machine.
Fig. Web Garden

Determine, what is the role of the current user :-
User.IsInRole("Administrators")

How do you get a User Identity :-
User.Identity.IsAuthenticated.ToString(), User.Identity.Name

Default authentication method when create a new Web application project :-
Windows authentication

Neutral cultures :-
represent general languages, such as English. ASP.NET assigns that culture to all the threads running for that Web application. When user set culture attribute for a Web application in Web.config.ASP.NET maintains multiple threads for a Web application within the aspnet_wp.exe worker process.

Steps to get user's culture at run time :-
string sLang = Request.UserLanguages[0];
CultureInfo CurrentCulture = new CultureInfo(sLang);
lblCulture.Text = CurrentCulture.EnglishName + ":" + CurrentCulture.Name;

3 ways to globalize web applications :-
Detect and redirect approach,
Run-time adjustment approach,
Satellite assemblies approach

Globalization :-
Creating an application that meets the needs of users from multiple cultures

Dynaimically assign a Master Page :-
this.MasterPageFile = "~/MasterPage.master";

Session Identifier :-
To identify session. It has SessionID property.

SessionID :-
To identify the request from the browser used sessionID. SessionId value stored in a cookie.

Different states in ASP.NET :-
view state, application state, session state.
We cant use jscript & vbscript togather, since compiler are different.

Utility used to add an assembly into the GAC :-
gacutil.exe

Purpose of System.Collections.Generic :-
More safty and better performance strongly typed collections are useful for the user

Global.asax :-
stored in root directory, an optional file, it contained in HttpApplicationClass, declare global variables like variables used in master pages because these variables can be used for different pages right. It handle two event: 1.Application-level  2.Session-level events.
default Expiration Period for Session is 20 minutes, default Expiration Period for Cookie is 30 minutes, maximum size of the viewstate is 25% of the page size

Two levels of variable supported by Asp.net :-
1. Page level variable: String ,int ,float.
2. Object level variable: Session level, Application level.

Error Events in Asp.Net :-
Page_Error:When exception occures in a page then this event raised. Application_error:Application_Error event raised when unhandled exceptions in the ASP.NET application and is implemented in global.asax.

Difference between Compiler and Translator :-
Compiler converet the program one computer language to another computer language. Traslator traslate one language to many other language like english to hindi, french etc.

Two Types of Debbuger :-
1.CorDBG – command-line debugger.
2.DbgCLR – graphic debugger.

Difference Between Thread and Processs :-
Thread is a part of process. process is the collection of thread.

Custom tag in web.config file :-
Custom tag allows you to create your own tag and specify key value pair for it.

Retrieve username in case of Windows Authentication :-
System.Environment.UserName

EnableViewStateMAC :-
When EnableViewStateMAC is true for a page, the encoded and encrypted viewstate is checked to verify that it has not been tempered with on the client machine.

What is Diffgram? and a good use for one :-
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.

Lifespan for items stored in ViewState :-
Item stored in ViewState exist for the life of the current page. This includes postbacks.

User controls and custom controls :-
A control authored by a user or a third-party software vendor that does not belong to the .NET Framework class library(dll). In ASP.NET: A user-authored server control that enables an ASP.NET page to be re-used as a server control(.ascx).

Web page belong in the .NET Framework class hierarchy :-
System.Web.UI.Page

Prevent a browser from caching an ASPX page :-
Response.Cache.SetNoStore();

AspCompat="true" mean and when should I use it :-
AspCompat is an aid in migrating ASP pages to ASPX pages.

event handlers can I include in Global.asax :-
Application_Start, Application_End, Application_Error, Session_Start, Session_End etc.

Explicitly kill a user s session :-
Session.Abandon

Load a user control dynamically in runtime :-
Control c = (Control)Page.LoadControl("~/usercontrol/MyUserControl.ascx");
Page.Form.Controls.Add(c);
or
Panel1.Controls.Add(c);

Get the authentication mode from web.config file programmatically at runtime :-
System.Web.Configuration.AuthenticationSection section = (AuthenticationSection)WebConfigurationManager.GetSection("system.web/authentication");
Label1.Text = section.Mode.ToString();

Convert an Array into an ArrayList :-
ArrayList myPersonList = ArrayList.Adapter(myPersonArray );

Convert an ArrayList into an Array :-
Person[] personArray = (Person[])myPersonList.ToArray(typeof(Person));

Smart navigation :-
Persists element focus during postbacks, persists scroll position during postbacks between pages, retains the lasts page information in the history of the browser
                
Code group :-
Code groups represent collections of code and each code group has an associated set of permissions.

Types of cookies are there in ASP.NET :-
1. Single valued: request.cookies(”dotnetfunda”)=”Sheo”
2. Multi valued: request.cookies(”donetfunda”)(”uname”)=”MAJITH”

Role of inetinfo.exe, aspnet_isapi.dll and aspnet_wp.exe :-
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.

ASP Session vs ASP.NET Session :-
asp.net session supports cookie less session & it can span across multiple servers.

Role-Based security :- 
A role is a named set of principals that have the same privileges with respect to security (such as a teller or a manager).

Maximum Data that can be stored in a cookie :- 4 kb
Significance of AutoEventWireUp attribute :-
Gets or sets a value indicating whether events for ASP.NET pages are automatically connected to event-handling functions.

Difference between Localization and Globalization :-
Globalization is process of identifying how many resources needs to be localized to adopt a multiple culture support, while Localization is actual process of translating resource to a specific culture. So Localization is the part of Globalization.

get the current Page Url :- Request.Url.ToString()

Classes from the System.Web.Mail namespace :- SmtpClient, MailMessage

Maximum number of cookies that can be allowed to a web site :- 20

Property is used to set a crosspage posting :- PostBackUrl

Regular expression is used to validate a 10 digit phone fied :- [0-9]{10} \d{10}

If we remove a web.config file from the application , is this application will work :- Depends on coding

event that is not fired during page cycle :- Page_Render()

Purpose of Server.MapPth :- To Get Physical Path of the Applcation

Function is used to count more than two billion rows in a table :- Count_BIG()

Name of base class for .NET :- System.Object

Difference between Callbacks and Postback in ASP.NET :-
Callback: It is a way to send a request to the web page from the client script. Postback is an expensive call with processing overhead. PostBack: Postback is the event which sends the form data to the server. The server processes the data & sends it back to the browser.

Can an ASPX file contain more than one form marked with runat="server" :- No.

Which method of HTTP Handler gets invoked when request is received :- ProcessRequest() method.

How do you create a permanent cookie :- HttpCookie.Expires = Date.MaxValue

Turn off cookies for one page in your site :- Cookie.Discard Property

Can we execute any web site without the web.config file :-
Yes, application will inherit cofiguration setting from machine.config file.

What’s the Difference Between <%# i %> and <%= i %> :- 
data binding syntax: <%# i %> and
code rendering syntax: <%= i %>

Is it possible that cookies created by asp.net application can only be accessed via server side code only :-
<system.web>
<httpCookies httpOnlyCookies=”true”>

You catch an unhandled exception in a Page_Error handler. How can you access the last error :- Server.GetLastError()

Can the App_Code folder contain source code files in different programming languages :-
<compilation debug="true">
<codeSubDirectories>
<add directoryName="VBCode"/>
</codeSubDirectories>

Different code models available in ASP.NET 2.0 :- single-file page and code behind page

Which typically consumes more memory: application state or session state :-
Session state, because copies of all variables are stored for each user.

Which might not work if a user has disabled cookies in his or her Web browser: application state or session state :-
Session state

What is View State Chunking :-
New in ASP.NET, version 2.0, If the data is too long for a single field, then ASP.NET performs view state chunking to split it across multiple hidden fields.

Which control requires the Web.sitemap file to display site map information :- SiteMapPath

What is the name of the virtual page that you can request to view trace data when the trace data is not displayed on its corresponding Web page :-
Virtual page is called Trace.axd

Which method would you call to send an e-mail message and wait for the transmission to complete before proceeding :- SmtpClient.Send
You need to obtain performance information about your Web Application. You should use which of the following :- Performance Counters

What launch conditions do Web Setup Projects include by default :-
By default, Web Setup Projects check for IIS and the .NET Framework.

four phases of a Web Setup Project deployment :- Install, Commit, Rollback, and Uninstall.

can we update a connection string stored in the Web.config file programatically :-
Yes, Create a Configuration object. Then, update the connection string using the ConnectionStrings collection. Finally, call Configuration.Save.

When file upload control is used, you can add maximum 4 mb size of the file. property use to extend the file size :- MaxRequestlength Property(2GB file)

Cookie Munging :- Cookie Munging is nothing but how ASP.NET manages session variables without cookies.

Difference between Session.Clear() and Session.RemoveAll() method :-
No difference, Session.RemoveAll() methods internally makes a call to Clear() method only.

Is it possible to set SessionState to readonly mode :- Only read data from session but not

write any data in session variable :- EnableSessionState property has a value "Readonly"

Is it possible to use InProc mode for sessionState in case of web garden :-
No, it's not possible.As InProc mode is dependent on the worker process and in case of web garden, we have multiple worker process so session handling becomes difficult. we can use StateServer or SQL server mode for web garden.

HttpApplicationState class stores data in :- Server Memory

How many ContentsPlaceHolder Controls contains to the MasterPage by default :- 2

Which element is used to apply a theme to the current application withint the web.config :-
<pages theme="name"/>

The URL for a Secure Connection starts with :- Https

Which property is used to check the current connection is secure :- IsSecureConnection

The FormsAuthentication class is in the :- System.Web.Security

To Create a Email Message in HTML format,set the IsBodyHtml Property to :- True

Name of the base class, from which all the validators controls of ASP.NET is derived :- BaseValidator Class except Validation Summary Control

Which protocol for defining the format of an Email message :- MIME

Name the constructor which creates a client that can send email to the specified SMTP server :- SmtpClient(name)

Object type collections are located in the whcih NameSpace :- System.Collections

Generic Collections are located in which NameSpace :- System.Collections.Generic

It is possible to get class or struct indexed just like arrays using :- Indexers
What is difference between TransferRequest and Transfer method :-
Transfer: Terminates execution of the current page and starts execution of provided URL. TransferRequest: Performs an asynchronous execution of the provided URL.

Difference between Eval() and Bind() :-
Eval():- Eval() method proviedes only for displaying data from a datasource in a control.
Bind():- Bind() methods provides for two-way binding which means that it cannot be used to dispaly as well update data from a datasource

Which of the following method is correct to send an Email Message :-   Send(from,to,subject,body)

What are the different level of settings are available for configure cookies in browser :-
1. Accept All Cookies
2. Low
3. Medium
4. Medium High
5. Block All Cookies

How can we disabled session for an ASP.NET Application :- <SessionState Mode="Off">

How can we disable session in Page Level :- <%@ page Langauge="C#" EnableSessionState="False"

Process is used to run ASP.NET Application from Visual Studio IDE :-   WebDev.WebServer.Exe

Process Used for Maintain State Server Session :- aspnet_state.exe
Is it possible to add APP_Code folder in web application project in Visual Studio 2005 or later :-
No. It's not possible. Web application project does not allow users to add app_code folder where website project does.

Is it possible to maintain scroll bar positions during postbacks  :-
Yes, <%@ Page Language="cs" AutoEventWireup="false" MaintainScrollPositionOnPostback="true" %>

Garbage collector runs :- When application is running low of memory

How to handle EmptyDataTemplate with repeater :-
you can’t find <EmptyDataTemplate> with repeater. to keep label(initially hidden) in the footer template of repeater.

How many ViewState objects can be created on an aspx page :- There is no limit.

What is Captacha Image and why it is used :-
CAPTCHA =”Completely Automated Public Turing test to tell Computers and Humans Apart." It means that it’s kind of test which a human can pass but a computer program cannot pass it.

How do you send data through querystring to another page without displaying it in the URL :- Use Server.Transfer method

You need to prefix something with the retrieved amount (Positive, negative, zeros). How will you handle this :-
Dim num As Double num = 100 Dim MyString As String = num.ToString("Test positive : #,##0.00;")

What is capacity and length for StringBuilder :- the default capacity of the stringbuilder is 16.

Can we use session variable in App_code Class page :- Yes. By using "HttpContext.Current.Session("VarName") "

How to redirect user to secure connection :-
To redirect user to https.
UriBuilder testuri = new UriBuilder(Page.Request.Url);
testuri.Scheme = testuri.UriSchemeHttps;

What is the difference between UniqueID and ClientID :-
both the properties are associated with asp.net control. The difference is Unique ID has '$' (Dollar) sign and Client ID adds '_' (underscore) to the control, if master page is used. So client ID will be ct100_ContentPlaceHolder1_txtName where Unique ID will be ct100$ContentPlaceHolder1$txtName.

Can I make viewstate enabled for controls where Enableviewstate of the container page is set to false :- No

What is PLINQ :-
PLIONQ stands for parallel LINQ. As the name clearly implies it is parallel implementation of LINQ to Objects. (Introduced with VS 2010)

What is the size of the session ID  :- 32 bit long integer

What Type of Processing model asp.net simulates :- Event-driven

Which class can be used to perform data type conversion between .NET data types and XML types :- XmlConvert

What method must be overridden in a custom control :- The Render() method

How to start NotePad file in AsP.NET with code :-   System.Diagnostics.Process.Start("Notepad.exe");

Which one is faster – DirectCast or CTYpe :-
DirectCast. CType uses the Visual Basic run-time helper routines for conversion

What will it result… CInt(1.8) CInt(-1.8) CInt(-1.2) :- 2,-2,-1

How to print out all the variables in the Session :- Yes, Using "Session.Keys" we can get all session variables

All session content can be Removed :- Yes, Session.Contents.RemoveAll()
What are the common security threats for any asp.net application :-
1. Cross side scripting
2. SQL Injection
3. Storing Password in simple format.
4. No validation for user input.

What is Reference Equality :-
To determine whether two variables refer to the same underlying object in memory is called Reference Equality.

What is Value Equality :-
To determine whether two objects contain the same value or values is called Value Equality.

Performing binary operations with Double type can result :-
PositiveInfinity or NegativeInfinity, Zero, NaN

What is  ?? operator :-
?? is called null-coalescing operator. It is used to define default value of nullable types.

is there any event "ModeChanged" :-
Yes. The event "ModeChanged" is available with DetailsView Control. (edit,insert and read-only)

What should be done to avoid Script Injection :-
1. Don't allow user to enter < and > characters as input.
2. Always Encode user's input and then store in the database.

Session state variables are type safe :- False

What is an HTTP Handler :-
This is a process which runs in response to a request made by an ASP.NET Web application. This is also referred to as endpoint. The ASP.NET page handler processes .aspx files. When a user requests an .aspx file, then the request is processed by the page through the page handler. It is also possible to create an HTTP handler that render custom output to the browser.

What is HTTP module :-
These are the assemblies, and when you are sending any requests to your application then this assembly will call. This is also a part of the ASP.NET request pipeline and has access to life-cycle events throughout the request. HTTP modules are examining the incoming and outgoing requests and it takes action based on the request made by user.

What is the interface that you have to implement to create a Custom HTTP Handler :-
Implement IHttpHandler interface to create a synchronous handler. Implement IHttpAsyncHandler to create an asynchronous handler.

What is the difference between Synchronous and Asynchronous HTTP Handlers :-
When you call for a HTTP request, unless until it finished the processing of assigned task, the Synchronous HTTP handler doesn't return any value. It will return a value after successful execution of sent request. But in case of asynchronous handler, it will run a process independently and it will send a response to the end user. When you are working with some lengthy application processes, then it is advisable to use Asynchronous handler. Here the user doesn't need to wait until it finishes before receiving a response from the server.

How can you create your own custom HTTP handler factory class :-
Yes, with the help of class by implementing the IHttpHandlerFactory interface

What is the co-relation and difference between HTTP handlers and HTTP modules :-
The co-relation between HTTP handler and HTTP module is both are an integral part of the ASP.NET application. For each request is being send by the user for processing, the request will process by multiple HTTP modules and after that the request is processed by a single HTTP handler. When a request is processed by HTTP handler, then the request goes back to the user through HTTP modules. The handlers are used to process individual endpoint requests made by the user. It returns a response to a request that is identified by a file name extension. It also enables ASP.NET application to process the HTTP URL extensions and is implementing the IHttpHandler interface, which is located in the System.Web namespace. These are analogous to Internet Server Application Programming Interface (ISAPI) extensions. The modules are used to invoke all requests and responses made by the user. It is executed before and after the handler executes. It also enables user to modify each individual request. These modules implementing IHttpModule interface, which is located in the System.Web namespace.

Explain 3 levels at which a theme can be applied for a web application :- At page level, At application level, At web server level

Where does Static variables store :- Static variables are stored on the Heap of the memory

What is Screen Scraping :- It means reading the contents of the WebPage.

What is the use of DataSet.CaseSensitive property :-
If the CaseSensitive property of a DataSet is set to true, then the string comparisons for all the DataTables within dataset will be case sensitive. By default the CaseSensitive property is always false.

Main advantage of URL Re-Writting :-
1. It would make the URL quite simple and understandable for this we need to avoid ( =,  :- ) in query string.
2. Increase the Rank of the page through dynamic URL's,
3. No extension is shown.(Security Aspect)

What is the difference between GetType and TypeOf :-
The GetType function, which is used to get the type of an object based on that object that is the instance of that class. It means that, this function needs parameter as an argument of object rather than class name. But in case of typeOf , we have to pass that class name as a parameter. This function is used to get the type based on a class. That is suppose you will use typeOf function with an object as a argument, then it will give you error.
string str = “Hello”;
Type val1 = str.GetType();
Type val2 = typeof(string);

Define casting of a data type ? What are the two types of data type conversions :-
Casting a data type is nothing but converting a variable from one data type to another data type. 1. Implicit conversions, 2. Explicit conversions

What are the different protocols used by a .Net Web Service :-
A web service can bind with three different protocols such as Http-Get, Http-Post, and SOAP. It is preferable to use Http-Get and Http-Post only when name/value pairs of data is avilable. But if the data is complex in nature use soap.

Explain the requirement of ASP.NET web services :-
The ASP.NET web services are used for B2B applications like authorizing employees, supplier, signing of invoice etc. These web services are the way to expose the middle tier components through internet. With the help of these components, you can communicate across the firewalls as they use SOAP as a transport protocol

What are the main advantages of binary serialization :-
The main purpose of using serialization and deserialization is to transfer the data in a linear form over a network.

Which one of the following file store the method signature information for an XML WebService :- .wsdl file

How to make an ASP page to refresh after certain time :-
<meta http-equiv="refresh" content="15" />

What is the use of culture attribute of the globalization element in web.config :-
this attribute is to specify the Web application which deals with various culture-dependent issues, such as date time, formatting of document etc. Here the role of globalization element is to create culture-specific Web applications.

How you can determine validity of an XML document :-
The Document Type Definition (DTD) or the XML Schema determines the validity of an XML document.Because the XML documents are compared with DTD and schema rules as specified in that.

Which of these files affects the settings of Windows as well as web applications :-  Machine.config

Which event is fired when any button is Clicked in a GridView :- RowCommand

How to change the CssClass of a server control without writing any code for checking the browser :-
<asp:Label Id="Label1" ie:CssClass="ieClass" mozilla:CssClass="mozClass" />

Which mode should be used to maintain session state even if the Web Server crashes :- SqlServer

A web user control has been created in WebSite1. Can we use it in WebSite2, WebSite3 etc. :- Yes, you can use it in WebSite2, WebSite3. Add Existing Item from solution explorer

Difference between ViewState and ControlState :-
ViewState can be disabled while the Control State cannot be disabled. ViewState is implemented by using EnableViewState property of a control to true. Control State works even when EnableViewState is off.

Why we use error pages in asp.net :- Error Pages are used to perform customized actions in case of errors like 403: Forbidden, 500: Internal Server Error

What is TDD environment :- ASP.NET MVC framework helps to do test driven development (TDD) environment.

Which of these data source control does not have the Caching feature :- LinqDataSource

What is the difference between the Take and Skip clauses :-
The Take clause returns a specified number of elements. The Skip clause skips the specified number of elements in the query and returns the rest.

What is the difference between the Select clause and SelectMany() method in LINQ :-
The Select clause is used to produce one result value for every source value. the SelectMany() method produces a single result that contains a concatenated collection from the query.

What is determined by the Culture and UICulture values :-
The Culture value determines the functions, such as Date and Currency , which are used to format data and numbers in a web page. The UICulture value determines the resources, such as strings or images, which are loaded for a web page in a web application.

What is aggregate dependency :- In this type of dependency, the removal of the data item from the cache depends on sum of all the defined dependencies.

Which of these event handlers is fired whenever the request is sent for the web page from the browser :- Application_BeginRequest

Difference between Server.Transfer and Response.Redirect :-
Server.Transfer(),
1.Server side page navigation no change in url.
2.Rountrip doesnot occurs.
3.Data can be persist across the pages using Context.Item collection
4.Can transfer data from one page to another keeping the page state alive.
Response.Redirect(),
1.client side page navigation through browser change in url.
2.Roundtrip occurs.
3.client know the physical loation (page name and query string as well). 4.Context.Items loses the persisitance when nevigate to destination page. 

Which of these objects can be used to implement Page output Caching :- Response

SSL (Secure Sockets Layer) :-
It ia secure way of sending data over the internet. It uses the https protocol and the appropriate security certificates(encryption keys). When a user requests a page using SSL, the web server generates an encryption key for the user and then encrypts the page data.the encrypted page is then sent to the browser. When the browser receives the SSL Page,it uses the same encryption key to decrypt the received page.

Process recycling :-
It is the technique using which the asp.net worker process (aspnet_wp.exe) can be shut down or restarted for the purpose of repairing/maintaining the web sites. we can do this by using the appropriate attributes in the <processModel> tag of the machine.config file.

Post-Cache Substitution :-
It is a feature of the ASP.NET Framework that allows us to cache asp.net page partially. example: We may need dynamic output on one part of the page, but the other part of the page should remain static(for AdRotator).

Scavenging :-
Scavenging is the process of deleting items from the cache when memory becomes low. The criteria of removing the cached elements is either their inactivity for some time or their low priority. CacheItemPriority enumeration is used to determine the priority of cached items for scavenging.

How can you prevent the page from scrolllng up and down when some postback occurs :-
In the Page directive add this attribute MaintainScrollPositionOnPostback=true

What is the use of ValidateRequest attribute in the Page directive :-
It is used to reduce the risk of cross-site scripting attacks for pages in ASP.NET applications. error messages like "Potentially dangerous value are generated because of this attribute.

What is a Global Theme :-
A Global Theme is available to all the Web Sites on your Web Server.

How can we change the writing direction to "right to left" :-
The wrting direction of .aspx page can be changed using the HTML dir attribute as shown below. <body dir="rtl">

Prevent server-side Caching in ASP.NET :- Response.Cache.SetNoServerCaching();

Which class you would use for pagination in DataList :-
PagedDataSouce is the class whose object is used for pagination in DataList.

HttpForbiddenHandler :-
It is a class used to issue the HTTP 403 error "Forbidden: Access is denied" or "This type of page is not served" error messages. when an attempt is made to access a resource mapped to this handler. You can use it to protect your files.

Configuration API :-
The configuration management APIs used in .NET, which enables user to programmatically build any kind of programs or scripts that create, load, and update the Web.config and machine.config configuration files.

Which is the first event handler that fires for a Web Site :- Applicaion_Start
Cached events :-
They are placed in the ViewState of the page and executed on the server side. example: TextChanged event of the TextBox. SelectedIndexChanged event of the DropDownList.

Difference between Session["uname"]=TextBox1.Text and Session.Add("uname",TextBox1.Text) :-
Session["uname"]=TextBox1.Text ; It uses an indexer to assign the data. Assigning data using an indexer is faster and more efficient than assigning the data using the method--Session.Add("uname",TextBox1.Text)

Why does not the SessionId change after Session.Abandon() method is called :-
It is because of the browser Session that is open till the browser is closed. The browser Session does not allow the browser cookies to be updated.

Which object do you use when you need to know the type and version of the browser requesting the current web page :-
HttpBrowserCapabilities

On which of these classes, we can apply skins :- Botton

Which of these security aspects allow you to modify users properties :- Membership

Which of these properties of a Web Page is true when you post to another page :- IsCrossPagePostBack

Which of these events of a web page are fired during asynchronous postback :- PreInit, Init, Load

Can we implement Cookieless Forms Authentication :-
Yes, <system.web> <authentication mode="Forms"> <forms cookieless="AutoDetect'> </authentication> </system.web>

Which is the base class for health-monitoring audit events :- WebAuditEvent is the correct base class

When health monitoring is enabled, which property is required in the health monitoring section of the web.config file :- heartbeatInterval

How can you prevent a cookie from cross side script attacks :-
Use HttpOnly property of the cookie when it is created. It prevents the cookie from being accessible through Javascript.

How many role providers are there in ASP.NET :-
Roles are basically classes that provide us with features to implement authorization for a group of users. SqlRoleProvider : we can store role information in SQL Server database, WindowsTokenRoleProvider: we can use Windows user accounts to represent roles, AuthorizationStoreRoleProvider : Manages storage of role-membership information in XML File/Active Directory /Active Directory Application Mode (ADAM)

Which of these techniques results in performance improvement of a web site :-
Publish web site, caching

How can you test whether the Windows user is authenticated :-
if (User.Identity.IsAuthenticated == true)
{
   Response.Write(User.Identity.Name + "---" + "authenticated");
}

Can we save ViewState on the server side :-
Yes, we can save ViewState on the server side. But we have to override two virtual methods known as LoadPageStateFromPersistenceMedium() and SavePageStateToPersistenceMedium() of System.Web.UI.Page class on the .aspx page.

Where does caching of a UserControl occur :- Web Server

After which of these events, ViewState of a Page is saved :- PreRenderComplete

What is Site Navigation :-
The Site Navigation system have the quality to define the entire site in an XML file that is called sitemap . After defining the sitemap you can use it out programatically using the sitemap class in your application.

What is the use of AutoEventWireUp attribute :-
The use of AutoEventWireUp attribute is to execute the code in the Page event handlers like Init, Load etc.

Difference between Session.Abandon() and Session.Clear() :-
Session.Abandon() will end current session by firing Session_End and in the next request, Session_Start will be fire. Session.Clear( ) just clears the session data without killing it.

.Net Remoting :-
.NET Remoting is a mechanism for communicating between objects which are not in the same process. .NET remoting enables you to build widely distributed applications easily, whether application components are all on one computer or spread out across the entire world.

By default where the sessions ID's are stored :- In cookies

Use of AutoWireup in asp.net :-
AutoEventWireup attribute is used to set whether the events needs to be automatically generated or not.

Exact purpose of http handlers :-
ASP.NET maps HTTP requests to HttpHandlers. Each HttpHandler enables processing of individual HTTP URLs or groups of URL extensions within an application. An HttpHandler can be either synchronous or asynchronous. A synchronous handler does not return until it finishes processing the HTTP request for which it is called. An asynchronous handler usually launches a process that can be lengthy and returns before that process finishes After writing and compiling the code to implement an HttpHandler you must register the handler using your application's Web.config file.

Difference between URL and URI :-
A URL (Uniform Resource Locator) is the address of some resource on the Web. A resource is nothing but a page of a site. There are other type of resources than Web pages, but that's the easiest conceptually. A URI is a unique identifier to usually a namespace. Though it looks like a URL but it doesn’t have to necessarily locate any resource on the web. URI is a generic term. URL is a type of URI.

What are Satellite assemblies and how to generate Satellite assemblies :-
To support the feature of multiple languages, we need to create different modules that are customized on the basis of localization.

Steps to generate satellite assemblies:
a. Set the paths for resgen and al.exe:
b. Create a .resources file.
c. Create the satellite assembly.
d. The assembly should have the naming convention for .NET to be able to search for it.
e. Specify the settings for culture.
f. Put the satellite assembly in the appropriate folder.
g. Once the satellite assembly is created, physically copy it to the appropriate directory.
h. Repeat the process for each language in which you are creating an assembly.

What is Authorization in ASP.NET :-
Authorization is a process that takes place based on the authentication of the user. Once authenticated, based on user’s credentials, it is determined what rights des a user have. a. File authorization b. URL authorization.

No comments:

Post a Comment