Saturday, May 1, 2010

Disable back button on browser



Call this in body tag of html :

onload="disableBackButton()"

IIS Isolation Levels?

Internet Information Server: IIS5 supports three isolation levels, that you can set from the Home Directory tab of the site Properties dialog:
* Low (IIS Process): ASP pages run in INetInfo.Exe the main IIS process, therefore they are executed in-process. The problem is that if ASP crashes, IIS crashes as well and must be restarted (IIS5 has a reliable restart feature that automatically restarts a server when a fatal error occurs).
* Medium (Pooled): In this case ASP runs in a different process, which makes this setting more reliable and if ASP crashes IIS will not crash. All the ASP applications at the Medium isolation level share the same process, so you can have a web site running with just two processes (IIS and ASP process). IIS5 is the first Internet Information Server version that supports this setting, which is also the default setting when you create an IIS5 application.
* High (Isolated): Each ASP application runs out-process in its own process space, therefore if an ASP application crashes, neither IIS nor any other ASP application will be affected. The downside is that you consume more memory and resources if the server hosts many ASP applications.

When selecting an isolation level for your ASP application keep in mind that out-process settings - that is, Medium and High - are less efficient than in-process (Low). However out-process communication has been vastly improved under IIS5 In practice, you shouldn't set the Low isolation level for an IIS5 application unless you really need to serve hundreds pages per second.

How you will handle session when deploying application in more than a server? Describe session handling in a webfarm, how does it work and what are th

By default, ASP.NET will store the session state in the same process that processes the request. ASP.NET can store session data in an external process which can even reside on another machine. To enable this feature:
* Start the ASP.NET state service, either using the Services snap-in or by executing "net start aspnet_state" on the command line. The state service will by default listen on port 42424.
* Set the mode attribute of the section to "StateServer".
* Configure the stateConnectionString attribute with the values of the machine on which you started aspnet_state.

How does an AppDomain get created?

AppDomains are usually created by hosts like Windows Shell, ASP.NET and IE etc.
When you run a .NET application from the command-line the host is the Shell. The Shell creates a new AppDomain for every application.

AppDomains can also be explicitly created by .NET applications. Here is a C# sample which creates an AppDomain creates an instance of an object inside it, and then
executes one of the object's methods.

using System;
using System.Runtime.Remoting;

public class AppDomainInfo : MarshalByRefObject

{
public string GetAppDomainInfo()

{
return "AppDomain = " + AppDomain.CurrentDomain.FriendlyName;
}
}

public class App
{

public static int Main()
{
AppDomain ad = AppDomain.CreateDomain( "My new domain", null, null );
ObjectHandle objh = ad.CreateInstance( "appdomaintest", "GetAppDomainInfo");
GetAppDomainInfo myInfo = (GetAppDomainInfo)(objh.Unwrap());
string info = myInfo.GetAppDomainInfo();
Console.WriteLine( "AppDomain : " + info );
return 0;
}
}