Thursday, April 30, 2009

CLR



The .NET Framework provides a runtime environment called the Common Language Runtime or CLR (similar to the Java Virtual Machine or JVM in Java), which handles the execution of code and provides useful services for the implementation of the program.

The Common Language Runtime is the underpinning of the .NET Framework. CLR takes care of code management at program execution and provides various beneficial services such as memory management, thread management, security management, code verification, compilation, and other system services. The managed code that targets CLR benefits from useful features such as cross-language integration, cross-language exception handling, versioning, enhanced security, deployment support, and debugging.

Common Type System (CTS) describes how types are declared, used and managed in the runtime and facilitates cross-language integration, type safety, and high performance code execution.

The Common Language Specification (CLS) is an agreement among language designers and class library designers to use a common subset of basic language features that all languages have to follow.


Reference: http://www.arunmicrosystems.netfirms.com/clr.html

Wednesday, April 15, 2009

Profile VS. Session

I would like to point out some of the similarities/differences bewteen both Session and Profile objects:

Profile:

1- Profile object is scoped to a particular user:
Each user of a web application automatically has his own profile.

2- Profile object is persistant:
When you modify the stat os the profile object, the modifications are saved between visits to the website

3- Profile object uses the provider model to store information:
By default, the contents of a user profile are automatically saved to a Microsoft SQL Server Express database
located in App_Data of your web application.

4- Profile object is strongly typed:
Using strongly typed properties has several advantages. For example, you get full Microsoft IntelliSense when
using the Profile object in VS.NET 2005 or Visual Web Developer


Session:

1- Session object is scoped to a particular user:
Each user of a web application automatically has his own Session state.

2- Session object is non-persistant:
When you add an item to the Session object, the items disappear after you leave the Web site.

3- Session object uses three different ways to be stored:
3.1:
In Process - default
3.2:
State Server (Out of Process)
3.3: SQL Server

4- Session object is not strongly typed:
Sessopn object is simply a collection of items.

Monday, April 13, 2009

Framework Differences

Framework 2.0

C# 2.0
  • generics
  • Partial Classes
  • Anonymous methods
  • Nullable type
  • Iterating over collections
  • Static Classes
  • Property accessor accessibility-Diiferent Accesors for Get and Set
  • System.IO.Ports ->Supply the SerialPort class to implement serial port operation.
  • System.IO.Compression -> Implement compression and decompression operation on files.
  • System.Net.NetworkInformation -> Gather information about network events, changes, statistics, and properties.
  • System.Security.AccessControl -> Provide programming elements used to control access to and audit security-related actions on securable objects.

General 2.0
  • 64-bit support
  • Click once deployement
  • Runtime debug and modify.

ASP.Net 2.0
  • ASP.NET WebParts
  • Richer ASP.NET controls which leads to quicker development cycles.
  • Master Pages
  • Themes and Skins
  • Introduction of new controls like GridView FormView DetailsView4.
  • dynamic menu
  • Navigation Controls.
  • classes in app_data folder that makes the classes define in it to be as a Compiled dll.
  • Compilation model: With 1.1, all code was compiled into one assembly placed in the bin directory. With 2.0, the assembly is separated into multiple assemblies. These multiple assemblies may be created on-the-fly or precompiled. Examples of multiple assemblies are one assembly for each ASP.NET directory like App_Code and App_Data as well as individual assemblies for Web Forms, User Controls, and so forth. This is a major shift in the application structure; it offers more deployment options in how the application is delivered to the users.
  • Built in Security engine and Profile Object (user profile persisted between sessions)
  1. Microsoft ASP.NET 2.0 supports a new object called the Profile object. We can store any type of information within a user profile including both simple data types such as strings and integers and complex types such as custom objects.
  2. The Profile object is similar to the Session object, but better. Like the Session object, In other words, each user of a Web application automatically has their own profile.
  3. However, unlike the Session object, the Profile object is persistent. When you add an item to the Session object, the item disappears after you leave the Web site. When you modify the state of the Profile object, in contrast, the modifications are saved between visits to the Web site

Framework 3.0
  • system.speech namespace, which contains Windows Desktop Speech technology types for implementing speech recognition.
  • Debugger Edit and Continue (enables a user who is debugging anapplication in Visual Studio to make changes to source code while executing in Break mode. After source code edits are applied, the user can resume code execution and observe the effect. ) With the release of 3.0 the .net framework 1.1 won't be patched
  • Windows Communication Foundation (WCF), formerly called Indigo; a service-oriented messaging system which allows programs to interoperate locally or remotely similar to web services.
  • Windows Presentation Foundation (WPF), formerly called Avalon; a new user interface subsystem and API based on XML and vector graphics, which uses 3D computer graphics hardware and Direct3D technologies.
  • Windows Workflow Foundation (WF) allows for building of task automation and integrated transactions using workflows.

Framework 3.5

It implement Linq evolution in language. So we have the following evolution in class:
  • Linq for SQL, XML, Dataset, Object
  • Automatic Properties, Object Initializer and Collection Initializers
  • Extension Methods
  • Lambda Expressions
  • Anonymous Types
  • Active directory
  • ASP.NET Ajax
  • Paging support for ADO.NET
  • ADO.NET synchronization API to synchronize local caches and server side datastores
  • Asynchronous network I/O API
  • Support for HTTP pipelining and syndication feeds





Wednesday, April 8, 2009

Onmouseover Changing header background color of accordian control

ASPX page code
<ajax:Accordion ID="MyAccordion" runat="server" SelectedIndex="0" HeaderCssClass="accordionHeader"
ContentCssClass="accordionContent" FadeTransitions="false" FramesPerSecond="40"
TransitionDuration="250" RequireOpenedPane="true" Width="100%" SuppressHeaderPostbacks="true">
<Panes>
<ajax:AccordionPane ID="AccordionPane1" runat="server">
<Header>
Login
</Header>
<Content>
Content 1 goes here
</Content>
</ajax:AccordionPane>
<ajax:AccordionPane ID="AccordionPane2" runat="server">
<Header>
Change password
</Header>
<Content>
Content 2 goes here
</Content>
</ajax:AccordionPane>
</Panes>
</ajax:Accordion>

Add the following script
here 'ctl00_ContentPlaceHolder1_MyAccordion_AccordionExtender' is used to access the accordian control.general way of accessing accordian control through jquery is as follows
$find('your accordian controls client id_AccordionExtender');
AccordionExtender is coomon so only change the client id while accessing your accordian control.

<script type="text/javascript">
function pageLoad()
{
//alert('in');
AddMouseOverToAccordion();
}


function AddMouseOverToAccordion()
{
var acc = $find('ctl00_ContentPlaceHolder1_MyAccordion_AccordionExtender');
//alert(acc.get_Count());
for(paneIdx = 0; paneIdx < acc.get_Count(); paneIdx++)
{
var k = null;
var j = null;
j= acc.get_Pane(paneIdx).header;
k = Function.createDelegate(this, this._onTitleHover);
$addHandler(j, "mouseover", k);

k = Function.createDelegate(this, this._onTitleHoverOut);
$addHandler(j, "mouseout", k);
}
}
function _onTitleHoverOut(e) {
e.target.style.background = "#2E4d7B";
e.target.style.color = "white";
}

function _onTitleHover(e) {
e.target.style.background = "#FFF8DC";
e.target.style.color = " #4B0082";
}

</script>