Tuesday, May 13, 2008

Application

Application_start
Called when the first resource (such as a page) in an ASP.NET application is requested. The Application_Start method is called only one time during the life cycle of an application. You can use this method to perform startup tasks such as loading data into the cache and initializing static values.
You should set only static data during application start. Do not set any instance data because it will be available only to the first instance of the HttpApplication class that is created.

Application_Event
Raised at the appropriate time in the application life cycle, as listed in the application life cycle table earlier in this topic.
Application_Error can be raised at any phase in the application life cycle.
Application_EndRequest is the only event that is guaranteed to be raised in every request, because a request can be short-circuited. For example, if two modules handle the Application_BeginRequest event and the first one throws an exception, the Application_BeginRequest event will not be called for the second module. However, the Application_EndRequest method is always called to allow the application to clean up resources.


Application_End
Called once per lifetime of the application before the application is unloaded.

Monday, May 12, 2008

differences between httphandlers and httpmodules?

HTTP Handlers - These are used for handling HTTP request with specified file type. e.g. There is one HTTP handler for aspx file, anothter http handler for .axd(trace) file, another one for asp file.HTTP Modules: These are used as filters which intercepts each http request before it is passed onto HTTP handlers regardless of file type. They are used for filtering incoming requests. Typeical use would be logging requests, authentication etc. for each and every incoming requests.

An ASP.NET HTTP handler is the process (frequently referred to as the "endpoint") that runs in response to a request made to an ASP.NET Web application. The most common handler is an ASP.NET page handler that processes .aspx files. When users request an .aspx file, the request is processed by the page through the page handler. You can create your own HTTP handlers that render custom output to the browser.
An HTTP module is an assembly that is called on every request that is made to your application. HTTP modules are called as part of the ASP.NET request pipeline and have access to life-cycle events throughout the request. HTTP modules let you examine incoming and outgoing requests and take action based on the request.

how can i get the parent window objects in the child window?

//server side

int sumRent =100;
Page.ClientScript.RegisterStartupScript(this.GetType(), "child", "");


//client side
var child=window.opener.document.getElementById('txtRentAmount').value;

diiference between Except and Intersect in sql server 2005?

Returns distinct values by comparing the results of two queries.
EXCEPT returns any distinct values from the left query that are not also found on the right query.
INTERSECT returns any distinct values that are returned by both the query on the left and right sides of the INTERSECT operand.
The basic rules for combining the result sets of two queries that use EXCEPT or INTERSECT are the following:
The number and the order of the columns must be the same in all queries.
The data types must be compatible.

difference between @Table datatype and temporary able?

Table variables are Transaction neutral. They are variables and thus aren't bound to a transaction.Temp tables behave same as normal tables and are bound by transactions.
The Next difference is that transaction logs are not recorded for the table variables. Hence, they are out of scope of the transaction mechanism.
The Third major difference is that any procedure with a temporary table cannot be pre-compiled, while an execution plan of procedures with table variables can be statically compiled in advance. Pre-compiling a script gives a major advantage to its speed of execution.
Finally, table variables exist only in the same scope as variables. Contrary to the temporary tables, they are not visible in inner stored procedures and in exec(string) statements. Also, they cannot be used in an insert/exec statement.

how can i get rownumber in sql server 2005?

by using row_number

can i overload or override properties?

Properties can't be overload
but it can be override