Monday, September 27, 2010

About ASP.NET

What is ASP.NET  and What is the Characteristics of ASP.NET?
ASP.NET provides an efficient development environment for developing web application.
ASP.net, a technology that enables the rapid development of powerful web applications and services. In other way ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language. The ASP.NET SOAP extension framework allows ASP.NET components to process SOAP messages.
Characteristics
Pages
.NET pages, known officially as "web forms", are the main building block for application development. Web forms are contained in files with an ".aspx" extension; these files typically contain static (XHTML)markup, as well as markup defining server-side Web Controls and User Controls where the developers place all the required static and dynamic content for the web page. Additionally, dynamic code which runs on the server can be placed in a page within a block which is similar to other web development technologies such as PHP,JSP and ASP, but this practice is generally discouraged except for the purposes of databinding since it requires more calls when rendering the page.
Note that this sample uses code "inline", as opposed to code-behind.

 

 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

   
   
   
        The current time is:
   
   

Code-behind model
Microsoft recommends dealing with dynamic program code by using the code-behind model, which places this code in a separate file or in a specially designated script tag. Code-behind files typically have names like MyPage.aspx.cs or MyPage.aspx.vb while the page file is MyPage.aspx (same filename as the page file (ASPX), but with the final extension denoting the page language). This practice is automatic in Microsoft Visual Studio and other IDEs. When using this style of programming, the developer writes code to respond to different events, like the page being loaded, or a control being clicked, rather than a procedural walk through the document.
ASP.NET's code-behind model marks a departure from Classic ASP in that it encourages developers to build applications with separation of presentation and content in mind. In theory, this would allow a web designer, for example, to focus on the design markup with less potential for disturbing the programming code that drives it. This is similar to the separation of the controller from the view in modal view controller  frameworks.
Example
The above tag is placed at the beginning of the ASPX file. The CodeFile property of the @ Page directive specifies the file (.cs or .vb) acting as the code-behind while the Inherits property specifies the Class the Page derives from. In this example, the @ Page directive is included in SampleCodeBehind.aspx, then SampleCodeBehind.aspx.cs acts as the code-behind for this page:
using System;
namespace Website
{
               public partial class SampleCodeBehind : System.Web.UI.Page
               {
                               protected void Page_Load(object sender, EventArgs e)
                               {
                                              Response.Write("Hello, world");
                               }
               }
}
In this case, the Page_Load() method is called every time the ASPX page is requested. The programmer can implement event handlers at several stages of the page execution process to perform processing.
 User controls
User controls are encapsulations of sections of pages which are registered and used as controls in ASP.NET. User controls are created as ASCX markup files. These files usually contain static (X)HTML markup, as well as markup defining server-side web controls where the developers place all the required static and dynamic content. A user control is compiled when its containing page is requested and is stored in memory for subsequent requests. User controls have their own events which are handled during the life of ASP.NET requests. An event bubbling mechanism provides the ability to pass an event fired by a user control up to its containing page. Unlike an ASP.NET page, a user control cannot be requested independently; one of its containing pages is requested instead.
Custom controls
Programmers can also build custom controls for ASP.NET applications. Unlike user controls, these controls don't have an ASCX markup file, having all their code compiled into a DLL file. Such custom controls can be used across multiple web applications and Visual Studio projects (which is not allowed with user controls). By using a Register directive, the control is loaded from the DLL.
Rendering technique
ASP.NET uses a visited composites rendering technique. During compilation, the template (.aspx) file is compiled into initialization code which builds a control tree (the composite) representing the original template. Literal text goes into instances of the Literal control class, and server controls are represented by instances of a specific control class. The initialization code is combined with user-written code (usually by the assembly of multiple partial classes) and results in a class specific for the page. The page doubles as the root of the control tree.
Actual requests for the page are processed through a number of steps. First, during the initialization steps, an instance of the page class is created and the initialization code is executed. This produces the initial control tree which is now typically manipulated by the methods of the page in the following steps. As each node in the tree is a control represented as an instance of a class, the code may change the tree structure as well as manipulate the properties/methods of the individual nodes. Finally, during the rendering step a visitor is used to visit every node in the tree, asking each node to render itself using the methods of the visitor. The resulting HTML output is sent to the client.
After the request has been processed, the instance of the page class is discarded and with it the entire control tree. This is a source of confusion among novice ASP.NET programmers who rely on class instance members that are lost with every page request/response cycle.
State management
ASP.NET applications are hosted by a web server and are accessed using the stateless HTTP protocol. As such, if an application uses stateful interaction, it has to implement  state management on its own. ASP.NET provides various functions for state management. Conceptually, Microsoft treats "state" as GUI state. Problems may arise if an application needs to keep track of "data state"; for example, a finite state machine which may be in a transient state between requests (Lazy evolution) or which takes a long time to initialize.
Application state
Application state is held by a collection of shared user-defined variables. These are set and initialized when the Application_OnStart event fires on the loading of the first instance of the application and are available until the last instance exits. Application state variables are accessed using the Applications collection, which provides a wrapper for the application state variables. Application state variables are identified by name.
Session state
Server-side session state is held by a collection of user-defined session variables that are persisted during a user session. These variables, accessed using the Session collection, are unique to each session instance. The variables can be set to be automatically destroyed after a defined time of inactivity even if the session does not end. Client-side user session is maintained by either a cookie or by encoding the session ID in the URL itself.
ASP.NET supports three modes of persistence for server-side session variables:
In-Process Mode
The session variables are maintained within the ASP.NET process. This is the fastest way; however, in this mode the variables are destroyed when the ASP.NET process is recycled or shut down.
ASPState Mode
ASP.NET runs a separate Windows service that maintains the state variables. Because state management happens outside the ASP.NET process, and because the ASP.NET engine accesses data using .NET Remoting, ASPState is slower than In-Process. This mode allows an ASP.NET application to be load-balanced and scaled across multiple servers. Because the state management service runs independently of ASP.NET, the session variables can persist across ASP.NET process shutdowns. However, since session state server runs as a single instance, it is still a single point of failure for session state. The session-state service cannot be load-balanced, and there are restrictions on types that can be stored in a session variable.
SqlServer Mode
State variables are stored in a database , allowing session variables to be persisted across ASP.NET process shutdowns. The main advantage of this mode is that it allows the application to balance load on a server cluster, sharing sessions between servers. This is the slowest method of session state management in ASP.NET.
View state
View state refers to the page-level state management mechanism, utilized by the HTML pages emitted by ASP.NET applications to maintain the state of the web form controls and widgets. The state of the controls is encoded and sent to the server at every form submission in a hidden field known as __VIEWSTATE. The server sends back the variable so that when the page is re-rendered, the controls render at their last state. At the server side, the application may change the viewstate, if the processing requires a change of state of any control. The states of individual controls are decoded at the server, and are available for use in ASP.NET pages using the ViewState collection.
The main use for this is to preserve form information across postbacks. View state is turned on by default and normally serializes the data in every control on the page regardless of whether it is actually used during a postback. This behavior can (and should) be modified, however, as View state can be disabled on a per-control, per-page, or server-wide basis.
Developers need to be wary of storing sensitive or private information in the View state of a page or control, as the base64 string containing the view state data can easily be de-serialized. By default, View state does not encrypt the __VIEWSTATE value. Encryption can be enabled on a server-wide (and server-specific) basis, allowing for a certain level of security to be maintained.
Server-side caching
ASP.NET offers a "Cache" object that is shared across the application and can also be used to store various objects. The "Cache" object holds the data only for a specified amount of time and is automatically cleaned after the session time-limit elapses.
 Other
Other means of state management that are supported by ASP.NET are  cookies caching,  and using the query string.

Extension

Microsoft has released some extension frameworks that plug into ASP.NET and extend its functionality. Some of them are:
ASP.NET AJAX
An extension with both client-side as well as server-side components for writing ASP.NET pages that incorporate AJAX functionality.
ASP.NET MVC Framework
An extension to author ASP.NET pages using the  MVC architecture.

Sunday, September 5, 2010

Amezing qualities of SharePoint

Microsoft always provide us better environment and great platform to perform our task,so moving ahead in this Microsoft provide SharePoint for developing website,portals,content management system etc.now i'm going to describ briefly what is Sharepoint, history of SharePoint.

What is SharePoint ?

Microsoft SharePoint, is a software platform and a family of software products developed by Microsoft for collaboration and web publishing combined. These capabilities include developing web sites, portals, intranets, content management systems, search engines, wikis, blogs, and other tools for business intelligence. This family of products include: Microsoft SharePoint Server, Microsoft SharePoint Foundation, Microsoft Search Server, Microsoft SharePoint Designer and Microsoft SharePoint Workspace.


History of SharePoint

The first version, called SharePoint Team Services (usually abbreviated to STS), was released at the same time as Office XP and was available as part of Microsoft FrontPage. STS could run on Windows 2000 Server or Windows XP.

Windows SharePoint Services 2.0 was marketed as an upgrade to SharePoint Team Services, but was in fact a completely redesigned application. SharePoint Team Services stored documents in ordinary file storage, keeping document metadata in a database. Windows SharePoint Services 2.0 on the other hand, stores both the document and the metadata in a database, and supports basic document versioning for items in Document Libraries. Service Pack 2 for WSS added support for SQL Server 2005 and the use of the .NET Framework 2.0.

Windows SharePoint Services 3.0 was released on November 16, 2006 as part of the Microsoft Office 2007 suite and Windows Server 2003. WSS 3.0 is built using .NET Framework 2.0 and .NET Framework 3.0 Windows Workflow Foundation to add workflow capabilities to the basic suite. By the beginning of 2007 WSS 3.0 was made available to the public. Windows 2000 Server is not supported by WSS 3.0.

WSS version 3 marked a significant maturation of the product. Version 3 supported more features commonly used in Web 2.0 solutions like Blogs, Wikis and RSS feeds. Microsoft has launch next version 4.0 to SharePoint Foundation 2010.

Features in SharePoint Foundation 2010

Microsoft SharePoint Foundation (formerly known as Windows SharePoint Services) is a free add-on to Microsoft Windows Server 2003 and 2008 providing a web portal with commonly needed features.

1. Alerts Enhancements

Microsoft SharePoint Foundation 2010 expands the alerts framework to enable users to have alerts sent as Short Message Service (SMS) messages to their mobile devices.

Extensible Mobile Messaging Framework

________________________________________

SharePoint Foundation 2010 takes advantage of the new mobile messaging framework to enhance its Alerts feature. To support the new option, the SPAlert class now has a property that indicates whether the alert is delivered as e-mail or as an SMS message. The SharePoint Foundation Web application is given its own account, which can be programmatically changed, with a mobile messaging service provider.

The mobile messaging framework is itself extensible, so you can create your SharePoint Foundation solutions that incorporate SMS messages that are sent to mobile telephones. You can create a completely customized alert system if you want. If your messaging solution uses the Office Mobile Service (OMS) protocol, most of your development work has already been done for you. A rich set of classes has been added to the object model to represent the Web Methods and response types of the protocol. If your solution requires a different protocol, base classes have been provided with default implementations of essential properties and methods.

2. Business Connectivity Services

Microsoft Business Connectivity Services (BCS), formerly named the Business Data Catalog, provides read/write access to external data from line-of-business (LOB) systems, Web services, databases, and other external systems within Microsoft SharePoint 2010. SharePoint 2010 has product features that can use external data directly, both online and offline. Developers can gain access to a rich set of features and rapidly build solutions by using familiar tools such as Microsoft Visual Studio 2010 and Microsoft SharePoint Designer 2010.

Business Connectivity Services enhances SharePoint application capabilities and their UI through features, services, and tools. These enhanced capabilities and UI streamline development of solutions with deep integration of external data and services. Power users, developers, and business unit IT professionals can integrate assets from external systems and enable interaction with the external data through many types of applications. The Business Connectivity Services feature set enables rapid development and deployment of scalable and security-rich solutions.

The following are some of the features of Business Connectivity Services.

Write-back to External Systems

________________________________________

Using Business Connectivity Services, you can create, read, update, delete, and query (CRUDQ) to the external system from a Microsoft Office application or SharePoint site if the external system supports the operations and is modeled appropriately in the Business Data Connectivity (BDC) service.

Familiar UI

________________________________________

External content types provide SharePoint behaviors (such as lists, Web Parts, and profile pages) to external data and services. As a result, users can work in their familiar work environments without needing to learn different (and often proprietary) user interfaces.

More Connectivity Options

________________________________________

The core function of BDC is to provide connectivity support to the following types of external systems:

• Databases

• Web and Windows Communication Foundation (WCF) services

• Microsoft .NET connectivity assemblies

• Custom data sources

Extensible Provider Model

________________________________________

In addition to connectors for the previous list of data sources provided by BDC, BDC provides a pluggable framework with which developers can plug in connectors for new external system types, thus enabling these new data source types to be accessed via the BDC.

Batch and Bulk Operation Support

________________________________________

In Office SharePoint Server 2007, BDC supported only single item operations, such as search. BDC now provides batch and bulk operation support which enable you to read multiple items in a single call thus reducing round trips to the backend dramatically.

Read BLOBs

________________________________________

BDC now supports reading Binary Large Object (BLOB) data. This is useful for streaming BLOBs of data from the external system.

Read and Write-back of Complex Types

________________________________________

BDC now supports dot notation in field names and therefore enables you to read and write complex types.

Life Cycle Management

________________________________________

Business Connectivity Services provides a set of tools to facilitate creation of models and Office 2010 application artifacts, declaratively and by writing code. You can use SharePoint Designer 2010 to rapidly create composite solutions that meet external unit needs without writing code. You can use Visual Studio to create or extend solutions with sophisticated workflows and data that spans structured LOB systems, unstructured SharePoint applications or Microsoft Office applications, and Web 2.0 services.

Enhanced API Set and Extensibility

________________________________________

Developers can use the BDC Runtime object model to write generic applications by using the stereotyped APIs as building blocks. Such generic applications are then assured to work against any external system, including those that are preexisting and those that are yet to be built.

Developers can also write specific applications that make assumptions about the abstract entity model (the fields exposed by these, and the types of the fields).

And with the .NET Assembly Connector, Custom Connector and the pluggable Secure Store Provider, it provides a rich extensibility mechanism for software developers.

3. Client Object Model

________________________________________Microsoft SharePoint Foundation 2010 introduces three new client APIs for interacting with SharePoint sites: from a .NET managed application (not earlier than Microsoft .NET Framework 3.5), from a Microsoft Silverlight application (not earlier than Silverlight 2.0), or from ECMAScript (JavaScript, JScript) that executes in the browser. These new APIs provide access to a subset of the types and members that are contained in the Microsoft.SharePoint namespace of the server-side object model.

The new client object models provide an object-oriented system for interoperating with SharePoint data from a remote computer, and they are in many respects easier to use than the already existing SharePoint Foundation Web services. You start by retrieving a client context object that represents the current request context, and through this context, you can obtain access to client objects at site-collection level or lower in the SharePoint Foundation hierarchy. Client objects inherit from the ClientObject class (ECMAScript: ClientObject), and you can use them to retrieve properties for a specific SharePoint object, to retrieve child objects and their properties, or to retrieve child items from a collection.

4 Custom Field Rendering Enhancements

Microsoft SharePoint Foundation 2010 makes two significant changes to the way that you define how custom field types render.

XSLT Stylesheet Rendering on List Views

________________________________________

In Windows SharePoint Services 3.0, fields were rendered on list view pages by a RenderPattern element in a field definition file, fldtypes*.xml. In SharePoint Foundation 2010, fields are rendered on list view pages by XSLT stylesheets. Consequently, you now define the rendering of your custom field types by creating a custom XSLT stylesheet rather than adding a custom RenderPattern element to a field type definition. See How to: Create a Custom Field Type Definition and Understanding the FldTypes.xml File for more information about field type definitions. See Overview of XSLT List View Rendering System and How to: Customize the Rendering of a Field on a List View for more information about XSLT rendering and how to customize it.

RenderPattern Elements are Now Obsolete

________________________________________

In Windows SharePoint Services 3.0, fields were also typically rendered in Display mode by means of a RenderPattern element in a field definition file. It was also possible, although rare, to render a field in Edit and New modes with a RenderPattern element. It was more common to render fields in Edit and New modes with a user control (ASCX), known as a RenderingTemplate, and it was possible to use a user control to render a field in Display mode. In SharePoint Foundation 2010, custom fields should always be rendered with user controls in all three modes. Although some long-standing built-in fields still use a RenderPattern element, for development of custom fields RenderPattern elements are obsolete.

PropertySchema Elements are Now Obsolete

________________________________________

In Windows SharePoint Services 3.0, when a custom field had a variable property (that is, a property with a different value on different lists), a control was needed on the New Site Column, Change Site Column, Create Column, and Change Column pages so that users could set the property value. One of the ways that custom field designers could define the rendering of this control was with a PropertySchema element in a field definition file. This method is now obsolete. You should create an editing control as a user control (ASCX). Point your custom field to the user control by setting the FieldEditorUserControl property. For more information about such editor controls, see Custom Field Type Property Rendering and How to: Create an Editor Control for a Field Type Property.

Backward Compatibility

________________________________________

If there is no user control (RenderingTemplate) for a field, the runtime looks for a RenderPattern element in the field type definition file and, if found, uses it. One implication of this behavior is that custom fields that you created for versions earlier than SharePoint Foundation 2010 can still use their existing field type definitions with RenderPattern elements for Display, Edit, or New mode.

SharePoint Foundation 2010 will not automatically render your legacy custom fields on list views by using the Render Pattern in the field type definition for the field. However, if you do not want the default rendering that is given to the field by the XSLT stylesheet, you can re-enable the RenderPattern by adding a TRUE element to the field type definition. For more information, see Understanding the FldTypes.xml File and RenderPattern Element (Field Types).

Friday, September 3, 2010

Latest programming language trends among developers

Programming language trends among developers have changed during the last centuries. Many years ago most people started to learn Basic which was useful for writing some easy programs and understanding the ropes of programming. This programming language is useful to get knowledge about the fundamentals to learn programming but you need to learn other programming languages if you want to develop complicated programs or software. The kind of programs or software you want to write is important for choosing the best programming language for your needs.



Developers of software are experienced in many computer programming languages and they often use the one which is most useful for writing software for a certain application. The time that Cobol was the number one in programming languages is passed and you may wonder why. It is one of the oldest programming languages and was especially used for business software. A disadvantage of this programming language is that programming in this language requires too many codes.


Nowadays there are several other programming languages which are more useful for writing software and runs faster on your computer. Here are some hottest language trends which we notice during the last years:


*Java


Java is certainly one of the hottest programming languages at this moment. It is widely used for web design and maybe is the graphic interface one of the reasons of its popularity. This programming language has similarities with another programming language, called C. Java is an object oriented language and that is maybe the most important difference with the programming language "C".


It is not a programming language which is easy to learn and there is need of a Java Virtual Machine to run programs which are written in this language. You probably came across different Internet sites which asked to download a certain program to read sites which are written in the programming language Java. It is an advantage that programs written in Java runs on different operating systems. It works as well in Windows as Linux. It is certainly useful for powerful applications.


*C


C was probably the most popular programming language before Java was launched. There are many similarities but this programming language is not so powerful as Java. This programming language has no graphic interface and that is one of the main disadvantages compared with Java. This language doesn't have a feature which checks some errors you've written. The lack of memory management is one of the most important disadvantages of this programming language. It is easier to learn than Java and C+ and useful for less powerful applications. It is still a popular programming language and it is useful to learn C first before you start with programming in Java


*Visual basic


Visual basic is maybe the easiest language to learn if you compare the most important ones. A disadvantage is that this programming language runs only on Windows platforms and can be considered as a scripting language for several Windows applications which run in Microsoft Office but you can also create some games in this language. It is not suitable for web design and it is maybe the best programming language if you want to become an experienced programmer of software. It is the start but you need certainly learn some other programming languages if you want a job in the programming business.


The trend of the hottest programming language trends will always change. Cobol was the most popular programming language many years ago and is still not death. Visual Basic may help you to learn the ropes of programming but you need certainly knowledge of C, C+ to get the best results if you want to write some software. Java may benefit you the most because its graphic interface and it is maybe the most popular one nowadays.