Monday, 2 November 2015

Immortal Coder: Steve Jobs explains what Object Oriented Programmi...

Immortal Coder: Steve Jobs explains what Object Oriented Programmi...: Interviewer: Would you explain, in simple terms, exactly what object-oriented software is? Steve Jobs:  Objects are like people. They&...

Thursday, 23 October 2014

How to copy DLL or take backup of GAC

  1. Go to Start >> Run
  2. enter command C:\WINDOWS\ASSEMBLY\gac_msil
  3. this will give you the explorer windows with all the folder containing each available .dll in GAC
  4. If you like to take backup of all dll then copy all of them or find folder name as per the dll name to copy just specific dll

To Install the dll in GAC without utility

  1.  Open the folder C:\WINDOWS\ASSEMBLY
  2.  Drag and drop the dll in to this folder.It will get installed.

Hope this will be useful. 

Tuesday, 24 June 2014

What's New in ASP.NET 4.5 and Visual Studio 2012


      This document describes new features and enhancements that are being introduced in ASP.NET 4.5. It also describes improvements being made for web development in Visual Studio (Visual Web Developer).        



Saturday, 29 March 2014

Using SQL Server database on other computer connected with LAN

By default Remote connections in SQL Server Express is turned off.
Just turn on the remote connections for SQL Express, enable TCPIP protocal and restart the service, check errorlog whether it's listening on all network adapters Now try to connect using the machine name (since it's dynamic) from the client pc
here is a step
  • Open SQL Server Configuration Manager
  • Select SQL Server Network Configuration
  • Chose your instance of SQL Server
  • Make sure that TCP/IP protocol is enabled
  • Right click TCP/IP protocol
  • Select properties
  • Click IP addresses tab
  • Scroll down to IP4. The IP address of the server should be here. Set active to yes and enabled to yes. Set TCP port to 1433
  • Scroll down to IPAll. Set TCP port to 1433
  • Make an inbound firewall rule for port 1433
  • open sql server management studio, right click server instance, properties->connections-> allow remote connections. Security-> SQL Server and Windows Authentication mode
  • restart sql server service
  • restart sql server browser
now use sql connection string COMPUTERNAME for E.g
data source=COMPUTERNAME;database=databasename;user id=sa;password=pass;" providerName="System.Data.SqlClient"
Reference Link: 

Thursday, 20 March 2014

Update TFS workspaces

To update tfs workspace name with your computer name execute this line of code in visual studio command prompt.

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE>tf workspaces /updateComputerName:SUYPC073


For other tfs workspaces commands go to this link

Thursday, 23 January 2014

Literal vs Label in

The main difference is that Literal controls just render out text, but Label controls surround it with <span> tags (Unless you use the AssociatedControlID property, in which case a Label control will render a <label> tag).

So, labels can be styled easier, but if you're just inserting text, literals are the way to go. Literal controls also have a handy property Mode which governs how the text is rendered. You can have it HTML-encoded, or rendered without any changes, or have any "unsupported markup-language elements" removed.

If you're not applying any styles (e.g. by using Label's CssClass property), it will be fine to replace Label controls with Literal controls.

<asp:Label EnableViewState="false" ID="Label8" runat="server" 
        AssociatedControlID="txtEmail">Email Address:</asp:Label>

<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
It is optimal to use a label element because it will correctly turn it into a html label element with the correct for attribute targeting your text box, so that if a user clicks on the label it automatically sets their cursor inside the text field.

Otherwise use the literal unless having the text wrapped in a span would be beneficial for css styling.

Friday, 10 January 2014

HTTP Request Lifecycle Events in IIS Pipeline

The life cycle of an ASP.NET application starts with a request sent by a browser to the Web server like IIS. If you are an ASP.NET developer who creates modules and handlers, it’s important to understand the the HTTP Request Lifecycle in IIS. This article will give you an overview of the order of events fired only in the 'Request Life Cycle' in IIS pipeline.
Note: In IIS 6.0, there are two request processing pipelines – one for native-code ISAPI filters and the other for managed applications like ASP.NET. However in IIS 7.0, there is one unified request processing pipeline for all requests. The ASP.NET runtime is integrated with the Web server. Also note that if IIS 7 is configured to work in Classic mode instead of Integrated mode, then it behaves like IIS 6.

When a request is made to IIS, it is queued in the application pool of the application. An application pool is a group of one or more URLs that are served by a worker process. The worker process(w3wp.exe) is responsible to forward the request to the application.
The request is processed by the HttpApplication pipeline and events are fired in the following order:
BeginRequest - The BeginRequest event signals the creation of any given new request. This event is always raised and is always the first event to occur during the processing of a request.
AuthenticateRequest - The AuthenticateRequest event signals that the configured authentication mechanism has authenticated the current request. Subscribing to the AuthenticateRequest event ensures that the request will be authenticated before processing the attached module or event handle.
PostAuthenticateRequest - The PostAuthenticateRequest event is raised after the AuthenticateRequest event has occurred. All the information available is accessible in the HttpContext’s User property.
AuthorizeRequest - The AuthorizeRequest event signals that ASP.NET has authorized the current request. You can subscribe to the AuthorizeRequest event to perform custom authorization.
PostAuthorizeRequest - Occurs when the user for the current request has been authorized.
ResolveRequestCache - Occurs when ASP.NET finishes an authorization event to let the caching modules serve requests from the cache, bypassing execution of the event handler and calling any EndRequest handlers.
PostResolveRequestCache – Reaching this event means the request can’t be served from the cache, and thus a HTTP handler is created here. A Page class gets created if an aspx page is requested.
MapRequestHandler - The MapRequestHandler event is used by the ASP.NET infrastructure to determine the request handler for the current request based on the file-name extension of the requested resource.
PostMapRequestHandler - Occurs when ASP.NET has mapped the current request to the appropriate HTTP handler
AcquireRequestState - Occurs when ASP.NET acquires the current state (for example, session state) that is associated with the current request. A valid session ID must exist.
PostAcquireRequestState - Occurs when the state information (for example, session state or application state) that is associated with the current request has been obtained.
PreRequestHandlerExecute - Occurs just before ASP.NET starts executing an event handler
ExecuteRequestHandler – Occurs when handler generates output. This is the only event not exposed by the HTTPApplication class.
PostRequestHandlerExecute - Occurs when the ASP.NET event handler has finished generating the output
ReleaseRequestState - Occurs after ASP.NET finishes executing all request event handlers. This event signal ASP.NET state modules to save the current request state.
PostReleaseRequestState - Occurs when ASP.NET has completed executing all request event handlers and the request state data has been persisted.
UpdateRequestCache - Occurs when ASP.NET finishes executing an event handler in order to let caching modules store responses that will be reused to serve identical requests from the cache.
PostUpdateRequestCache - When thePostUpdateRequestCache is raised, ASP.NET has completed processing code and the content of the cache is finalized.
LogRequest - Occurs just before ASP.NET performs any logging for the current request. The LogRequest event is raised even if an error occurs. You can provide an event handler for the LogRequest event to provide custom logging for the request.
PostLogRequest - Occurs when request has been logged
EndRequest - Occurs as the last event in the HTTP pipeline chain of execution when ASP.NET responds to a request. In this event, you can compress or encrypt the response.
PreSendRequestHeaders – Fired after EndRequest if buffering is turned on (by default). Occurs just before ASP.NET sends HTTP headers to the client.
PreSendRequestContent - Occurs just before ASP.NET sends content to the client.

Total Pageviews