Wednesday, May 26, 2010

Basic Convertors Links.

1. Convert PDF to Word for Free
2. vb-to-csharp
3. csharp-to-vb

Wednesday, May 19, 2010

WCF Interview Questions

What is the use of ServiceBehavior attribute in WCF ?
ServiceBehaviour attribute is used to specify the InstanceContextMode for the WCF Service class (This can be used to maintained a state of the service or a client too)
There are three instance Context Mode in the WFC
PerSession : This is used to create a new instance for a service and the same instance is used for all method for a particular client. (eg: State can be maintained per session by declaring a variable)
PerCall : This is used to create a new instance for every call from the client whether same client or different. (eg: No state can be maintained as every time a new instance of the service is created)
Single : This is used to create only one instance of the service and the same instance is used for all the client request. (eg: Global state can be maintained but this will be applicable for all clients)

What is a SOA Service?
SOA is Service Oriented Architecture. SOA service is the encapsulation of a high level business concept. A SOA service is composed of three parts.
1. A service class implementing the service to be provided.
2. An environment to host the service.
3. One or more endpoints to which clients will connect.

What is WCF?
Answer edited by Webmaster
Windows Communication Foundation (WCF) is an SDK for developing and deploying services on Windows. WCF provides a runtime environment for services, enabling you to expose CLR types as services, and to consume other services as CLR types.
WCF is part of .NET 3.0 and requires .NET 2.0, so it can only run on systems that support it.

Difference between WCF and Web services?
Web Services
1.It Can be accessed only over HTTP
2.It works in stateless environment

WCF
WCF is flexible because its services can be hosted in different types of applications. The following lists several common scenarios for hosting WCF services:
IIS
WAS
Self-hosting
Managed Windows Service

What are the various ways of hosting a WCF service?
Self hosting the service in his own application domain. This we have already covered in the first section. The service comes in to existence when you create the object of ServiceHost class and the service closes when you call the Close of the ServiceHost class.
Host in application domain or process provided by IIS Server.
Host in Application domain and process provided by WAS (Windows Activation Service) Server.

What is three major points in WCF?
We Should remember ABC.
Address --- Specifies the location of the service which will be like http://Myserver/MyService.Clients will use this location to communicate with our service.
Binding --- Specifies how the two paries will communicate in term of transport and encoding and protocols
Contract --- Specifies the interface between client and the server.It's a simple interface with some attribute.

What is the difference WCF and Web services?
Web services can only be invoked by HTTP (traditional webservice with .asmx). While WCF Service or a WCF component can be invoked by any protocol (like http, tcp etc.) and any transport type.
Second web services are not flexible. However, WCF Services are flexible. If you make a new version of the service then you need to just expose a new end. Therefore, services are agile and which is a very practical approach looking at the current business trends.
We develop WCF as contracts, interface, operations, and data contracts. As the developer we are more focused on the business logic services and need not worry about channel stack. WCF is a unified programming API for any kind of services so we create the service and use configuration information to set up the communication mechanism like HTTP/TCP/MSMQ etc
For more details, read http://msdn.microsoft.com/en-us/library/aa738737.aspx

What are various ways of hosting WCF Services?
There are three major ways of hosting a WCF services
• Self-hosting the service in his own application domain. This we have already covered in the first section. The service comes in to existence when you create the object of Service Host class and the service closes when you call the Close of the Service Host class.
• Host in application domain or process provided by IIS Server.
• Host in Application domain and process provided by WAS (Windows Activation Service) Server.
What was the code name for WCF?
The code name of WCF was Indigo .
WCF is a unification of .NET framework communication technologies which unites the following technologies:-
NET remoting
MSMQ
Web services
COM+

What are the main components of WCF?
The main components of WCF are
1. Service class
2. Hosting environment
3. End point

How to deal with operation overloading while exposing the WCF services?
By default overload operations (methods) are not supported in WSDL based operation. However by using Name property of OperationContract attribute, we can deal with operation overloading scenario.
[ServiceContract]
interface ICalculator
{
[OperationContract(Name = "AddInt")]
int Add(int arg1,int arg2);
[OperationContract(Name = "AddDouble")]
double Add(double arg1,double arg2);
}

LINQ Interview Questions

Which assembly represents the core LINQ API?
System.Query.dll assembly represents the core LINQ API.

What is the use of System.Data.DLinq.dll?

System.Data.DLinq.dll provides functionality to work with LINQ to SQL.

What is the use of System.XML.XLinq.dll?
System.XML.XLinq.dll contains classes to provide functionality to use LINQ with XML.

Why can't datareader by returned from a Web Service's Method

Cos, it's not serializable

What is the LINQ file extension that interacts with Code Behind's objects.
its .dbml

What is the extension of the file, when LINQ to SQL is used?
The extension of the file is .dbml

Why Select clause comes after from clause in LINQ?
The reason is, LINQ is used with C# or other programming languages, which requires all the variables to be declared first. From clause of LINQ query just defines the range or conditions to select records. So that’s why from clause must appear before Select in LINQ.

How LINQ is beneficial than Stored Procedures?
There are couple of advantage of LINQ over stored procedures.

1. Debugging - It is really very hard to debug the Stored procedure but as LINQ is part of .NET, you can use visual studio's debugger to debug the queries.

2. Deployment - With stored procedures, we need to provide an additional script for stored procedures but with LINQ everything gets complied into single DLL hence deployment becomes easy.

3. Type Safety - LINQ is type safe, so queries errors are type checked at compile time. It is really good to encounter an error when compiling rather than runtime exception!

What is LINQ?
It stands for Language Integrated Query. LINQ is collection of standard query operators that provides the query facilities into .NET framework language like C# , VB.NET.

What is a Lambda expression?
A Lambda expression is nothing but an Anonymous Function, can contain expressions and statements. Lambda expressions can be used mostly to create delegates or expression tree types. Lambda expression uses lambda operator => and read as 'goes to' operator.

Left side of this operator specifies the input parameters and contains the expression or statement block at the right side.

Example: myExp = myExp/10;

Now, let see how we can assign the above to a delegate and create an expression tree:

delegate int myDel(int intMyNum);
static void Main(string[] args)
{
//assign lambda expression to a delegate:
myDel myDelegate = myExp => myExp / 10;
int intRes = myDelegate(110);
Console.WriteLine("Output {0}", intRes);
Console.ReadLine();

//Create an expression tree type
//This needs System.Linq.Expressions
Expression myExpDel = myExp => myExp /10;
}
How do we write a LINQ query to search with criteria?
We need to put the where clause before the 'select' keyword.
var q1 = from clsCustomer Obj in objCustomer where Obj.customerCode == "001" select Obj;

How can do a join using LINQ query?

Below is the LINQ code snippet for creating joins between object collections. In this case we are creating a join on customer and orders. If you remember the order collection was contained in the customer class.

var q1 = from clsCustomer ObjCust in objCustomer
from clsOrder ObjOrder in ObjCust.Orders
select ObjCust;

How can we do a group by using LINQ query?

Below is the code snippet which shows how group by query is written using LINQ. You can see we have created first a temp variable i.e. 'GroupTemp' and then we have used the 'Select' clause to return the same.

var GroupCustomers = from ObjCust in objCustomer
group ObjCust by ObjCust.City into GroupTemp
select new {GroupTemp.Key,GroupTemp};


How can we do an order by using LINQ query?

Order by in LINQ is pretty simple. We just need to insert order by before the 'Select' query.
return from clsCustomer ObjCust in objCustomer
orderby ObjCust.City
select ObjCust;

Note:
The => operator has the same precedence as assignment (=) and is right-associative.

Lambdas are used in method-based LINQ queries as arguments to standard query operator methods such as Where.

Dataset to excel multiple worksheets using .Net


The aim of this Article is provide a native .NET solution to dataset to excel multiple worksheets without using COM interop or OLEDB connection


You can use a library called ExcelLibrary. It's a free, open source library posted on Google Code:

ExcelLibrary

Here is sample Code:


DataSet ds = new DataSet();

DataTable dt1 = new DataTable("Table 1");
dt1.Columns.Add("Column A", typeof(String));
dt1.Columns.Add("Column B", typeof(String));
dt1.Rows.Add("Test 1", "Test 2");
dt1.Rows.Add("Test 3", "Test 4");
ds.Tables.Add(dt1);

DataTable dt2 = new DataTable("Table 2");
dt2.Columns.Add("Column C", typeof(String));
dt2.Columns.Add("Column D", typeof(String));
dt2.Rows.Add("Test 5", "Test 6");
dt2.Rows.Add("Test 7", "Test 8");
ds.Tables.Add(dt2);

DataTable dt3 = new DataTable("Table 3");
dt3.Columns.Add("Column E", typeof(String));
dt3.Columns.Add("Column F", typeof(String));
dt3.Rows.Add("Test 9", "Test 10");
dt3.Rows.Add("Test 11", "Test 12");
ds.Tables.Add(dt3);

DataSetHelper.CreateWorkbook("D:\\ExcelMultipleSheets\\ExcelMultipleSheets_Test.xls", ds);

Tuesday, May 18, 2010

ASP .Net AJAX Interview Questions

Q1 - What is AJAX?


A - Ajax stands for Asynchronous Javascript & XML. It is a web technology through which a postback from a client (browser) to the server goes partially, which means that instead of a complete postback, a partial postback is triggered by the Javascript XmlHttpRequest object. In such a scenario, web-application users won't be able to view the complete postback progress bar shown by the browser. In an AJAX environment, it is Javascript that starts the communication with the web server.
Ajax technology in a website
may be implemented by using plain Javascript and XML. Code in such a scenario may tend to look little complex, for which the AJAX Framework in .NET can be embedded in ASP.NET web applications.
In addition to XML & Javascript, AJAX is also based on DOM - the Document Object Model technology of browsers through which objects of the browser can be accessed through the memory heap using their address.
JSON - Javascript Object Notation is also one of the formats used in AJAX, besides XML.
So basically, in an AJAX-based web application, the complete page does not need to reload, and only the objects in context of ajaxification are reloaded.
Ajax technology avoids the browser flickering.

Q2 - Can Ajax be implemented in browsers that do not support the XmlHttpRequest object?


A - Yes. This is possible using remote scripts.

Q3 - Can AJAX technology work on web servers other than IIS?


A - Yes, AJAX is a technology independent of web server the web application is hosted on. Ajax is a client (browser) technology.

Q4 - Which browsers support the XmlHttpRequest object?


A - Internet Explorer 5.0+, Safari 1.2, Mozilla 1.0/Firefox, Opera 8.0 +, Netscape 7

Q5 - How to we create an XmlHttpRequest object for Internet Explorer
? How is this different for other browsers?


A - For Internet Explorer, an ActiveXObject is used for declaring an XmlHttpRequest object in Javascript.

//Code as below for IE:

xmlHttpObject = new ActiveXObject("Msxml2.XMLHTTP");

//For Other browsers, code as below:

xmlHttpObject = new XMLHttpRequest();

Note that XmlHttpObject used above is simply a variable that holds the XmlHttpRequest object for the respective browsers.

Q6 - What are the properties of the XmlHttpRequest object? What are the different types of readyStates in Ajax?


A - i) onreadyStateChange - This function is used to process the reply from the web server.

ii) readyState - This property holds the response status of the web server. There are 5 states:

0 - request not yet initialized

1 - request now set

2 - request sent

3 - request processing

4 - request completes

iii) responseText - Has the data sent back by the web server

Code snippet below shows an example how these there properties are used to implement ajax :

xmlHttpObject.onreadystatechange=function()
{
if(xmlHttpObject.readyState==4)
{
document.Form1.time.value=xmlHttpObject.responseText;
}
}

Q7 - What is the ASP.NET Ajax Framework? What versions have been released so far?


A - ASP.NET AJAX is a free framework to implement Ajax in asp.net web applications, for quickly creating efficient and interactive Web applications that work across all popular browsers.

The Ajax Framework is powered with

1 - Reusable Ajax Controls

2 - Support for all modern browsers

3 - Access remote services and data from the browser without tons of complicated script.

Versions of Ajax release

1 - ASP.NET Ajax Framework 1.0 (earlier release to this was called the Atlas)
2 - ASP.NET Ajax Framework 1.0 was available as a separate download for ASP.NET 2.0

Q8 - What are Ajax Extensions?


A - The ASP.NET Ajax Extensions are set of Ajax-based controls that work in ASP.NET 2 (or above) based applications.

Ofcourse,they also need the Ajax runtime which is actually the Ajax Framework 1.0.

ASP.NET Ajax Extensions 1.0 have to be downloaded to run with ASP.NET 2.0

The new ASP.NET 3.5 Framework comes with the Ajax Library 3.5 (containing the Ajax Extensions 3.5). So in order to use the latest Ajax, simply download .NET 3.5 Framework.

Summary :
ASP.NET Ajax Extensions 1.0 -> For ASP.NET 2.0
ASP.NET Ajax Extensions 3.5 -> For ASP.NET 3.5

Q9 - What is the ASP.NET Control Toolkit?


A - Besides the Ajax Framework (which is the Ajax engine) and Ajax Extensions (which contain the default Ajax controls), there is a toolkit called the Ajax Control Toolkit available for use & download (for free). This is a collection of rich featured, highly interactive controls, created as a joint venture between Microsoft & the Developer Community.

Q10 - What is Dojo?


A - Dojo is a third-party JavaScript
toolkit for creating rich featured applications. Dojo is an Open Source DHTML toolkit written in JavaScript. It builds on several contributed code bases (nWidgets, Burstlib, f(m)), which is why we refer to it sometimes as a "unified" toolkit. Dojo aims to solve some long-standing historical problems with DHTML which prevented mass adoption of dynamic web application development.

For more on Dojo, check this link: Click Here

Q11 - How to handle multiple or concurrent requests in Ajax?


A - For concurrent requests, declare separate XmlHttpRequest objects for each request. For example, for request to get data from an SQL table1, use something like this...

xmlHttpObject1.Onreadystatechange = functionfromTable1();

and to get data from another table (say table2) at the same time, use

xmlHttpObject2.Onreadystatechange = functionfromTable2();

Ofcourse, the XmlHttpObject needs to be opened & parameters passed too, like as shown below...

xmlHTTPObject1.open("GET","http://"localhost// " + "Website1/Default1.aspx" true);

Note that the last parameter "true" used above means that processing shall carry on without waiting for any response from the web server. If it is false, the function shall wait for a response.

Q12 - How to create an AJAX website using Visual Studio?


A - Using Visual Studio Web Developer Express 2005 & versions above it, Ajax based applications may easily be created. Note that the Ajax Framework & Ajax Extensions should be installed (In case of VS 2005). If using Visual Studio 2008 Web Developer Express or above, Ajax comes along with it (so no need of a separate installation).

Steps: Start Visual Studio, Click on File -> New Website -> Under Visual Studio Installed templates -> Select ASP.NET Ajax-Enabled Site. Enter a location & select OK.

Q13 - What is the role of ScriptManager in Ajax?


A - ScriptManager class is the heart of ASP.NET Ajax. Before elaborating more on ScriptManager, note that ScriptManager is class and a control (both) in Ajax.

The ScriptManager class in ASP.NET manages Ajax Script Libraries, partial page rendering functionality and client proxy class generation for web applications and services. By saying client proxy class, this means an instance of the Ajax runtime is created on the browser.

This class is defined in the System.Web.Extensions.dll. You will find this DLL in your system's Global Assembly Cache at C:\Windows\Assembly (For XP)

The ScriptManager control (that we may drag on a web form) is actually an instance of the ScriptManager class that we put on a web page. The ScriptManager manages all the ASP.NET Ajax controls on a web page. Following tasks are taken care by the ScriptManager class:
1 - Managing all resources (all objects/controls) on a web page
2 - Managing partial page updates
3 - Download Ajax Script Library to the client (means to the browser). This needs to happen so that Ajax engine is accessible to the browsers javascript code.
4 - Interacting with UpdatePanel Control, UpdateProgress Control.
5 - Register script (using RegisterClientScriptBlock)
6 - Information whether Release OR Debug script is sent to the browser
7 - Providing access to Web service methods from the script by registering Web services with the ScriptManager control
8 - Providing access to ASP.NET authentication, role, and profile application services from client script after registering these services with the ScriptManager control
9 - Enable culture specific display of clientside script.
10 - Register server controls that implement IExtenderControl and IScriptControl interfaces.

ScriptManager class' EnablePartialRendering property is true by default.

Q14 - Can we override the EnablePartialRendering property of the ScriptManager class?


A - Yes. But this has to be done before the init event of the page (or during runtime after the page has already loaded). Otherwise an InvalidOperationException will be thrown.

Q15 - How to use multiple ScriptManager controls in a web page?


A - No. It is not possible to use multiple ScriptManager control in a web page. In fact, any such requirement never comes in because a single ScriptManager control is enough to handle the objects of a web page.

Q16 - Whats the difference between RegisterClientScriptBlock, RegisterClientScriptInclude and RegisterClientScriptResource?


A - For all three, a script element is rendered after the opening form tag. Following are the differences:
1 - RegisterClientScriptBlock - The script is specified as a string parameter.
2 - RegisterClientScriptInclude - The script content is specified by setting the src attribute to a URL that points to a script file.
3 - RegisterClientScriptResource - The script content is specified with a resource name in an assembly. The src attribute is automatically populated with a URL by a call to an HTTP handler that retrieves the named script from the assembly.

Q17 - What are type/key pairs in client script registration? Can there be 2 scripts with the same type/key pair name?


A - When a script is registered by the ScriptManager class, a type/key pair is created to uniquely identify the script.

For identification purposes, the type/key pair name is always unique for dentifying a script. Hence, there may be no duplication in type/key pair names.

Q18 - What is an UpdatePanel Control?


A - An UpdatePanel control is a holder for server side controls that need to be partial postbacked in an ajax cycle. All controls residing inside the UpdatePanel will be partial postbacked. Below is a small example of using an UpdatePanel.














As you see here after running the snippet above, there wont be a full postback exhibited by the web page. Upon clicking the button, the postback shall be partial. This means that contents outside the UpdatePanel wont be posted back to the web server. Only the contents within the UpdatePanel are refreshed.

Q19 - What are the modes of updation in an UpdatePanel? What are Triggers of an UpdatePanel?


A - An UpdatePanel has a property called UpdateMode. There are two possible values for this property: 1) Always 2) Conditional

If the UpdateMode property is set to "Always", the UpdatePanel control’s content is updated on each postback that starts from anywhere on the webpage. This also includes asynchronous postbacks from controls that are inside other UpdatePanel controls, and postbacks from controls which are not inside UpdatePanel controls.

If the UpdateMode property is set to Conditional, the UpdatePanel control’s content is updated when one of the following is true:
1 - When the postback is caused by a trigger for that UpdatePanel control.

2 - When you explicitly call the UpdatePanel control's Update() method.

3 - When the UpdatePanel control is nested inside another UpdatePanel control and the parent panel is updated.

When the ChildrenAsTriggers property is set to true and any child control of the UpdatePanel control causes a postback. Child controls of nested UpdatePanel controls do not cause an update to the outer UpdatePanel control unless they are explicitly defined as triggers for the parent panel.

Controls defined inside a node have the capability to update the contents of an UpdatePanel.


If the ChildrenAsTriggers property is set to false and the UpdateMode property is set to Always, an exception is thrown. The ChildrenAsTriggers property is intended to be used only when the UpdateMode property is set to Conditional.

Q20 - How to control how long an Ajax request may last?


A - Use the ScriptManager's AsyncPostBackTimeout Property.

For example, if you want to debug a web page but you get an error that the page request has timed out, you may set

where the value specified is in seconds.

Q21 - What is ASP.NET Futures?


A -
ASP.NET AJAX Futures

The new release includes support for managing browser history (Back button support), selecting elements by CSS selectors or classes, and information on accessing “Astoria” Web data services. The Futures (July 2007) release adds:

History support for the Safari browser, inclusion of “titles”, encoding and encrypting of server-side history state and the ability to handle history in the client without a server requirement.

CSS Selectors APIs have been modified to be applicable to W3C recommendations.

A script resource extraction tool that allows you to create script files on disk that originate from embedded resources in assemblies. Important: this version of the browser history feature is now outdated and should not be used. Instead, please download the ASP.NET 3.5 Extensions Preview, which contains the new version.

For More: Click Here

Q22 - What are limitations of Ajax?


A - 1) An Ajax Web Application tends to confused end users if the network bandwidth is slow, because there is no full postback running. However, this confusion may be eliminated by using an UpdateProgress control in tandem.
2) Distributed applications running Ajax will need a central mechanism for communicating with each other

Q23 - How to make sure that contents of an UpdatePanel update only when a partial postback takes place (and not on a full postback)?


A - Make use of ScriptManager.IsInAsyncPostBack property (returns a boolean value)

Q24 - How to trigger a postback on an UpdatePanel from Javascript?


A - Call the __doPostBack function. ASP.NET runtime always creates a javascript function named __doPostBack(eventTarget, eventArgument) when the web page is rendered. A control ID may be passed here to specifically invoke updation of the UpdatePanel.

Q25 - Which request is better with AJAX, Get or Post?


A - AJAX requests should use an HTTP GET request while retrieving data where the data does not change for a given URL requested. An HTTP POST should be used when state is updated on the server. This is in line with HTTP idempotency recommendations and is highly recommended for a consistent web application architecture.

Monday, May 17, 2010

How to Dynamically create Silverlight User control.

I have Add a dynamically created Silverlight User control in another Silverlight User Control. I create this control from a XML file data.

Here are the step and necessary Code for reference:

Step-1:
Add the usercontrol as per requirement.
Step-2:
In your MainPage.xml
Add : xmlns:local="clr-namespace:ProjectSample"

< Grid x:Name="LayoutRoot">
< Grid.RowDefinitions>
< RowDefinition Height="550*"/>
< RowDefinition Height="50"/>

< Grid.ColumnDefinitions>
< ColumnDefinition Width="Auto"/>

< Grid Grid.Row="0" Grid.Column="0">
< controlsToolkit:WrapPanel Orientation="Vertical" x:Name="AddressPanel" HorizontalAlignment="Left"/>
< Button x:Name="Save" Grid.Row="1" Grid.Column="0" Click="Save_Click" Content="Save" Height="22" Width="60" HorizontalAlignment="Center" VerticalAlignment="Top" TabIndex="8" Cursor="Hand"/>



Step-3:
In your MainPage.xml.cs

ucAddress ucObj;
for (int i = 0; i < 5; i++)
{
ucObj = new ucAddress();
ucObj.Name = "ucName" + i;
AddressPanel.Children.Add(ucObj);
}

Step-3:
Retriving the data from usercontrol and inserting it.
private void Save_Click(object sender, RoutedEventArgs e)
{
User usr;

for (int i = 0; i < 5; i++)
{
ucObj = (ucAddress)LayoutRoot.FindName("ucName" + i);
usr = new User();
usr.Email = "test@t.com";
usr.Firstname = ucObj.FirstNameData.Text;
usr.Lastname = ucObj.LastNameData.Text;
usr.Username = ucObj.CityData.SelectionBoxItem.ToString();
usr.Password = "pa55w0rd!";
usr.Sex = "M";
_RegDContext.Users.Add(usr);
}

_submitOp = _RegDContext.SubmitChanges();
_submitOp.Completed +=new EventHandler(_submitOp_Completed);

}

Hope this will be useful & your comments are mostly welcome.

Thursday, May 13, 2010

Jquery Tutorial Help

Hi,

I have collected the Jquery basic info from different sites, which will be helpful for the one who likes to learn Jquery.

$(this).hide()
Demonstrates the jQuery hide() function, hiding the current HTML element.
$("#test").hide()
Demonstrates the jQuery hide() function, hiding the element with id="test".
$("p").hide()
Demonstrates the jQuery hide() function, hiding all

elements.
$(".test").hide()
Demonstrates the jQuery hide() function, hiding all elements with class="test".

________________________________________

jQuery Element Selectors
$("p").css("background-color","yellow");
Syntax Description
$(this) Current HTML element
$("p") All

elements
$("p.intro") All

elements with class="intro"
$(".intro") All elements with class="intro"
$("#intro") The first element with id="intro"
$("ul li:first") The first <> element of each


    $("[href$='.jpg']") All elements with an href attribute that ends with ".jpg"
    $("div#intro .head") All elements with class="head" inside a
    element with id="intro"

    ________________________________________

    jQuery Name Conflicts

    jQuery uses the $ sign as a shortcut for jQuery.
    Some other JavaScript libraries also use the dollar sign for their functions (like Prototype).
    jQuery has a method called noConflict() to deal with this.
    var jq=jQuery.noConflict(), lets you use your own name (like jq) instead of the dollar sign.

    ________________________________________

    jQuery Events
    Here are some examples of event functions in jQuery:
    Event Function Binds a Function to
    $(document).ready(function) The ready event of a document
    (when an HTML document is ready to use)
    $(selector).click(function) The click event of selected elements
    $(selector).dblclick(function) The double click event of selected elements
    $(selector).focus(function) The focus event of selected elements
    $(selector).mouseover(function) The mouse over event of selected elements

    ________________________________________

    jQuery Effects

    Function Description
    $(selector).hide() Hide selected elements
    $(selector).show() Show selected elements
    $(selector).toggle() Toggle (between hide and show) selected elements
    $(selector).slideDown() Slide-down (show) selected elements
    $(selector).slideUp() Slide-up (hide) selected elements
    $(selector).slideToggle() Toggle slide-up and slide-down of selected elements
    $(selector).fadeIn() Fade in selected elements
    $(selector).fadeOut() Fade out selected elements
    $(selector).fadeTo() Fadeout selected elements to an opacity
    $(selector).animate() Run a custom animation on selected elements

    $(selector).hide(speed,callback)
    $(selector).show(speed,callback)
    $(selector).toggle(speed,callback)
    $(selector).slideDown(speed,callback)
    $(selector).slideUp(speed,callback)
    $(selector).slideToggle(speed,callback)
    $(selector).fadeIn(speed,callback)
    $(selector).fadeOut(speed,callback)
    $(selector).fadeTo(speed,opacity,callback)
    $(selector).animate({params},[duration],[easing],[callback])

    The speed parameter can take the values: "slow", "fast", "normal", or milliseconds.
    The opacity parameter in the fadeTo() functions allows fading to a given opacity.
    The callback parameter is the name of a function to be executed after the hide (or show) function completes.
    The key parameter is params. It defines the properties that will be animated. Many properties can be animated at the same time:
    The second parameter is duration. It defines the time used to apply the animation. I takes the values "fast", "slow", "normal", or milliseconds.

    **HTML elements are positioned static by default and cannot be moved.
    To make elements moveable, set the CSS position to relative or absolute.

    ________________________________________

    jQuery Callback Functions:

    Since JavaScript statements (instructions) are executed one by one - in a sequence, statements executed after an animation may create errors or page conflict because the animation is not yet completed.

    $("p").hide(1000,function(){
    alert("The paragraph is now hidden");
    });

    ________________________________________

    jQuery HTML Manipulation :
    Function Description
    $(selector).html(content) Changes the (inner) HTML of selected elements
    $(selector).append(content) Appends content to the (inner) HTML of selected elements
    $(selector).prepend(content) "Prepends" content to the (inner) HTML of selected elements
    $(selector).after(content) Adds HTML after selected elements
    $(selector).before(content) Adds HTML before selected elements

    jQuery CSS Functions :
    CSS Properties Description
    $(selector).css(name,value) Set the value of one style property for matched elements
    $(selector).css({properties}) Set multiple style properties for matched elements
    $(selector).css(name) Get the style property value of the first matched element
    $(selector).height(value) Set the height of matched elements
    $(selector).width(value) Set the width of matched elements

    Example
    $(selector).css({properties})
    $("p").css({"background-color":"yellow","font-size":"200%"});
    Example
    $(selector).css(name,value)
    $("p").css("background-color","yellow");
    ________________________________________

    What is AJAX?
    AJAX = Asynchronous JavaScript and XML.
    AJAX is a technique for creating fast and dynamic web pages.
    AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.

    AJAX and jQuery
    jQuery provides a rich set of methods (functions) for AJAX web development.
    With jQuery AJAX, you can request TXT, HTML, XML or JSON data from a remote sever using both HTTP Get and HTTP Post.
    And you can load remote data directly into selected HTML elements of your web page!

    jQuery AJAX Requests:
    Request Description
    $(selector).load(url,data,callback) Load remote data into selected elements

    $.ajax(options) Load remote data into an XMLHttpRequest object
    $.get(url,data,callback,type) Load remote data using HTTP GET
    $.post(url,data,callback,type) Load remote data using HTTP POST
    $.getJSON(url,data,callback) Load remote JSON data using HTTP GET
    $.getScript(url,callback) Load and execute a remote JavaScript file

    (selector) jQuery element selector
    (url) The URL (address) of data to be loaded
    (data) Key/value pairs of data to send to the server
    (callback) Function to be executed when data is loaded
    (type) Type of data to be returned (html,xml,json,jasonp,script,text)
    (options) All key/value pairs of options for a complete AJAX request

    ________________________________________

    jQuery Selectors :

    Selector Example Selects
    * $("*") All elements
    #id $("#lastname") The element with id=lastname
    .class $(".intro") All elements with class="intro"
    elemen $("p") All

    elements
    .class.class $(".intro.demo") All elements with class=intro and class=demo

    :firs $("p:first") The first <> element
    :last $("p:last") The last <> element
    :even $("tr:even") All even <> elements
    :odd $("tr:odd") All odd <> elements

    :eq(index) $("ul li:eq(3)") The fourth element in a list (index starts at 0)
    :gt(no $("ul li:gt(3)") List elements with an index greater than 3
    :lt(no) $("ul li:lt(3)") List elements with an index less than 3
    :not(selector) $("input:not(:empty)") All input elements that are not empty

    :header $(":header") All header elements <><>...
    :animated All animated elements

    :contains(text) $(":contains('W3Schools')") All elements which contains the text
    :empty $(":empty") All elements with no child (elements) nodes
    :hidden $("p:hidden") All hidden <> elements
    :visible $("table:visible") All visible tables

    s1,s2,s3 $("th,td,.intro") All elements with matching selectors

    [attribute] $("[href]") All elements with an href attribute
    [attribute=value]
    $("[href='#']") All elements with href attribute value="#"
    [attribute!=value]
    $("[href!='#']") All elements with href attribute value<>"#"
    [attribute$=value] $("[href$='.jpg']") All elements with href attribute value containing ".jpg"


    :input $(":input") All <> elements
    :text $(":text") All <> elements with type="text"
    :password $(":password") All <> elements with type="password"
    :radio $(":radio") All <> elements with type="radio"
    :checkbox $(":checkbox") All < input > elements with type="checkbox"
    :submit $(":submit") All <> elements with type="submit"
    :reset $(":reset") All <> elements with type="reset"
    :button $(":button") All < input > elements with type="button"
    :image $(":image") All < input > elements with type="image"
    :file $(":file") All < input > elements with type="file"

    :enabled $(":enabled") All enabled input elements
    :disabled $(":disabled") All disabled input elements
    :selected $(":selected") All selected input elements
    :checked $(":checked") All checked input elements


    ________________________________________

    jQuery Event Functions
    Event functions bind a function to an event for all matching elements.
    Example: $("img").click(function(){$("#n10").hide()})
    The example code will hide an element with id="n10" when any image is clicked.


    Event function Binds the function to
    $(document).ready(function) The ready event of a document
    (when an HTML document is ready to use)
    $(selector).blur(function) The blur event of matching elements
    $(selector).change(function) The change event of matching elements
    $(selector).click(function) The click event of matching elements
    $(selector).dblclick(function) The double click event of matching elements
    $(selector).error(function) The error event of matching elements
    $(selector).focus(function) The focus event of matching elements
    $(selector).keydown(function) The key down event of matching elements
    $(selector).keypress(function) The key press event of matching elements
    $(selector).keyup(function) The key up event of matching elements
    $(selector).load(function) The load event of matching elements
    $(selector).mousedown(function) The mouse down event of matching elements
    $(selector).mouseenter(function) The mouse enter event of matching elements
    $(selector).mouseleave(function) The mouse leave event of matching elements
    $(selector).mousemove(function) The mouse move event of matching elements
    $(selector).mouseout(function) The mouse out event of matching elements
    $(selector).mouseover(function) The mouse over event of matching elements
    $(selector).mouseup(function) The mouse up event of matching elements
    $(selector).resize(function) The resize event of matching elements
    $(selector).scroll(function) The scroll event of matching elements
    $(selector).select(function) The select event of matching elements
    $(selector).submit(function) The submit event of matching elements
    $(selector).unload(function) The unload event of matching elements

    ________________________________________

    jQuery Trigger Functions
    Trigger functions trigger events for all matching element.
    Example: $("button#demo").click()
    The example will trigger the click event for a button element with id="demo".
    Function Triggers
    $(selector).blur() The blur event of matching elements
    $(selector).change() The change event of matching elements
    $(selector).click() The click event of matching elements
    $(selector).dblclick() The double click event of matching elements
    $(selector).error() The error event of matching elements
    $(selector).focus() The focus event of matching elements
    $(selector).keydown() The key down event of matching elements
    $(selector).keypress() The key press event of matching elements
    $(selector).keyup() The key up event of matching elements
    $(selector).mousedown() The mouse down event of matching elements
    $(selector).mouseenter() The mouse enter event of matching elements
    $(selector).mouseleave() The mouse leave event of matching elements
    $(selector).mousemove( The mouse move event of matching elements
    $(selector).mouseout( The mouse out event of matching elements
    $(selector).mouseover() The mouse over event of matching elements
    $(selector).mouseup() The mouse up event of matching elements
    $(selector).resize() The resize event of matching elements
    $(selector).scroll() The scroll event of matching elements
    $(selector).select() The select event of matching elements
    $(selector).submit() The submit event of matching elements
    $(selector).trigger(event) The specified event for all matched elements
    $(selector).triggerHandler(event) The specified event for the first matched element

    ________________________________________

    jQuery Event Handler Functions
    Event handler functions binds event handlers to matching elements.
    Function Triggers
    $(selector).bind(event) Add one or more event handlers to matching elements
    $(selector).delegate(selector, event) Add an event handler to matching elements, now or in the future
    $(selector).die() Remove all event handlers added with the live() function
    $(selector).live(event) Add an event handler to matching elements, now or in the future
    $(selector).one(event) Add an event handler to matching elements. This handler can only be triggered once
    $(selector).unbind(event) Remove an added event handler from matching elements
    $(selector).undelegate(event) Remove an event handler to matching elements, now or in the future





    jQuery Effects Functions


    Hide / Show Description
    $(selector).show(speed,callback) Show selected elements
    $(selector).hide(speed,callback) Hide selected elements
    $(selector).toggle(speed,callback) Toggle hide and show for selected elements

    Slide
    $(selector).slideDown(speed,callback) Slide-show selected elements by adjusting height
    $(selector).slideUp(speed,callback) Slide-hide selected elements by adjusting height
    $(selector).slideToggle(speed,callback) Toggle slide-hide and slide-show for selected elements

    Fade in / out
    $(selector).fadeIn(speed,callback) Fade in selected elements to full opacity
    $(selector).fadeOut(speed,callback) Fade out selected elements to zero opacity
    $(selector).fadeTo(speed,opacity,callback) Fade selected elements to a given opacity

    Animation
    $(selector).animate(params,duration,effect,callback) Applies a "custom" animation for selected elements
    $(selector).stop() Stops running animations on selected elements

    Queue
    $(selector).clearQueue() Remove all queued functions (not yet run) for the selected element
    $(selector).delay() Set a delay for all queued functions (not yet run) for the selected element
    $(selector).dequeue() Run the next queued functions for the selected element
    $(selector).queue() Show the queued functions for the selected element


    jQuery HTML Manipulation Functions:

    These functions work for both XML documents and HTML documents. Exception: html()
    Manipulate Description
    $(selector).html(content) Set the content (inner HTML) of selected elements
    $(selector).text(text) same as html(), but tags will be escaped
    $(selector).attr(attr,value) Set an attribute and value of selected elements
    $(selector).val(value) Set the value of the first selected element

    Getting Contents
    $(selector).html( Get the contents (inner HTML) of the first selected element
    $(selector).text() Get the text content of all selected elements (combined)
    $(selector).attr(attr) Get the value of an attribute from selected elements
    $(selector).val() Get the current value of the first selected element

    Adding Content
    $(selector).after(content) Add content after selected elements
    $(selector).before(content) Add content before selected elements
    $(selector).insertAfter(selector) Add selected elements after selected elements
    $(selector).insertBefore(selector) Add selected elements before selected elements

    Manipulate CSS Description
    $(selector).addClass(content) Add a class to selected elements
    $(selector).removeClass(content) Remove a class from selected elements
    $(selector).toggleClass(content) Toggle between adding/removing a class from selected elements
    $(selector).hasClass(content) Check if the selected elements have a specified class

    Adding Inner Content
    $(selector).append(content) Append content to the inner content of selected elements
    $(selector).prepend(content) "Prepend" content to the inner content of selected elements
    $(content).appendTo(selector) Append selected elements to the inner content of selected elements
    $(content).prependTo(selector) "Prepend" selected elements to the inner content of selected elements

    Wrapping
    $(selector).wrap(content) Wrap each selected element within a content
    $(selector).wrapAll(content) Wrap all selected elements into one content
    $(selector).wrapinner(content) Wrap selected inner child contents within a content
    $(selector).unwrap() Remove and replace the parents of the specified elements

    Copy, Replace, Remove
    $(content).replaceAll(selector) Replace selected elements with selected elements
    $(selector).replaceWith(content) Replace selected elements with new content
    $(selector).empty() Remove all content and child elements from selected elements
    $(selector).remove() Remove all selected elements
    $(selector).removeAttr(attr) Remove a specified attribute from all selected elements
    $(selector).clone() Clone all selected elements
    $(selector).detach() Remove the specified elements from the DOM


    jQuery CSS Manipulation Functions :
    CSS Properties Description
    $(selector).css(name) Get the style property value of the first selected element
    $(selector).css(name,value) Set the value of one style property for all selected elements
    $(selector).css({properties}) Set multiple style properties for all selected elements

    CSS Size
    $(selector).height( Get the pixel height of the first selected element
    $(selector).height(value Set the height of all selected elements
    $(selector).width( Get the pixel width of the first selected element
    $(selector).width(value Set the width of all selected elements

    CSS Positioning
    $(selector).offset() Get the position of the first selected element relative to the document
    $(selector).offsetParent() Get the first parent element with an offset position
    $(selector).position() Get the position of the first selected element relative to the parent element

    $(selector).scrollTop() Get the scroll top offset of the first selected element
    $(selector).scrollTop(value) Set the scroll top offset of all selected elements
    $(selector).scrollLeft() Get the scroll left offset of the first selected element
    $(selector).scrollLeft(value) Set the scroll left offset of all selected elements

Expression Encoder 3 SDK on a 64-bit Box

If you plan on using the Expression Encoder 3 SDK on an 64-bit box, then there is one additional setup step that is necessary that the SDK documentation doesn’t cover.

Here are the steps I took:

1. Create a new C# Console application.

2. Add a Reference to the Expression Encoder 3 Assemblies located in “%SYSTEMDRIVE%\Program Files (x86)\Microsoft Expression\Encoder 3\SDK”

* Microsoft.Expression.Encoder.dll
* Microsoft.Expression.Encoder.Types.dll
* Microsoft.Expression.Encoder.Utilities.dll

3. Add a Reference to WindowsBase.dll

4. If you try to use anything in the Microsoft.Expression.Encoder namespace, you will get a runtime error:
System.IO.FileNotFoundException was unhandled
Message="Could not load file or assembly 'Microsoft.Expression.Encoder, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."

5.To fix this problem, you need to compile your application targeting a 32-bit (x86) platform: