Ramani Sandeep's Blog

DotNetting – Fast , Easy Way of Developing Applications

Archive for August, 2009

jQuery Tutorials ( Learn – Practice – Expert )

Posted by Ramani Sandeep on August 31, 2009

Article 1: Using jQuery With ASP.NET

This article has everything that is needed by programmer who want to start learning jQuery.

It includes the following topics:

  • Using jQuery in ASP.NET Page
  • jQuery Selectors
  • jQuery Chainability
  • jQuery Object Accessors
  • jQuery Events
  • Ajax using jQuery and ASP.NET
  • jQuery Ajax with JSON data
  • Effects with jQuery

Read Full Article: click here…

Article 2: Using jQuery to consume ASP.NET web services

First, It’ll cover the two requirements necessary when calling an ASMX web service that’s being JSON serialized by the ASP.NET AJAX extensions.
Then, It’ll show you how to do this with jQuery.
Finally, I’ll update the deferred content loading example accordingly.

Read Full Article: click here



Article 3: ON Hijacking and How ASP.NET AJAX 1.0 Avoids these Attacks

Recently some reports have been issued by security researchers describing ways hackers can use the JSON wire format used by most popular AJAX frameworks to try and exploit cross domain scripts within browsers.  Specifically, these attacks use HTTP GET requests invoked via an HTML <script src=""> include element to circumvent the "same origin policy" enforced by browsers (which limits JavaScript objects like XmlHttpRequest to only calling URLs on the same domain that the page was loaded from), and then look for ways to exploit the JSON payload content.

Read Full article: click here

Posted in ASP.NET Ajax, JQuery | Tagged: , , , , , , | Leave a Comment »

How to Programmatically detect Silverlight version?

Posted by Ramani Sandeep on August 31, 2009

Two questions that often arise when building Silverlight based websites are:

A. How do I detect if Silverlight is installed on a visitor’s browser?

B. How do I detect what version of Silverlight is installed on a visitor’s browser?

The answer to A is relatively simple since Silverlight.js (the standard Silverlight javaScript include file) contains a function that we can use. The function is called isInstalled and it returns true/false. You can use it the following way to detect if there is any Silverlight version installed:

<script src="Silverlight.js" type="text/javascript"></script>

var isSLInstalled = Silverlight.isInstalled(null)

The answer to B is a little more complex since for some reason there is no direct way to get Silverlight’s version number. Basically the only documented way to answer this question is to repeatedly call isInstalled with different version numbers until you get the right version.

Example:

Silverlight.isInstalled(’3.0′)

Silverlight.isInstalled(’2.0′)

Silverlight.isInstalled(’1.0′)

Read Full article: click here

Related useful post: How to add Silverlight version detection to Google Analytics ??

Posted in WPF / Silverlight | Tagged: | Leave a Comment »

JSON.Net

Posted by Ramani Sandeep on August 31, 2009

The Json.NET library makes working with JavaScript and JSON formatted data in .NET simple. Quickly read and write JSON using the JsonReader and JsonWriter or serialize your .NET objects with a single method call using the JsonSerializer.

Features

  • LINQ to JSON
  • The JsonSerializer for quickly converting your .NET objects to JSON and back again
  • Json.NET can optionally produce well formatted, indented JSON for debugging or display
  • Attributes like JsonIgnore and JsonProperty can be added to a class to customize how a class is serialized
  • Ability to convert JSON to and from XML
  • Supports multiple platforms: .NET, Silverlight and the Compact Framework

The JSON serializer is a good choice when the JSON you are reading or writing maps closely to a .NET class. The serializer automatically reads and writes JSON for the class.

For situations where you are only interested in getting values from JSON, don’t have a class to serialize or deserialize to, or the JSON is radically different from your class and you need to manually read and write from your objects then LINQ to JSON is what you should use. LINQ to JSON allows you to easily read, create and modify JSON in .NET.

Json.NET CodePlex Project

Json.NET Download

Posted in ASP.NET Ajax, JavaScript, JQuery, Linq | Tagged: , , | Leave a Comment »

Using jQuery Grid With ASP.NET MVC

Posted by Ramani Sandeep on August 27, 2009

A common scenario when building web user interfaces is providing a pageable and sortable grid of data. Even better if it uses AJAX to make it more responsive and snazzy. Since ASP.NET MVC includes jQuery, I figured it’d be fun to use a jQuery plugin for this demo, so I chose jQuery Grid.

After creating a standard ASP.NET MVC project, the first step was to download the plugin and to unzip the contents to my scripts directory per the Installation instructions.

 

Click here to read more…..

Posted in ASP.NET Ajax, ASP.NET MVC, JQuery | Tagged: , , , | 2 Comments »

WPF vs. Silverlight

Posted by Ramani Sandeep on August 27, 2009

Microsoft feels that user experience is important, and invested in multiple technologies to promote better user experience.  Both WPF and Silverlight use XAML (Extensible Application Markup Language) under the covers. 

Let’s look at some of the different characteristics of each technology: 

WPF:

  • Ships as part of the .NET Framework (version 3.0 and onward)
  • Runs as Windows application or as web "browser application" (called XBAP, for "XAML Browser Application").  Note that XBAPs run only in Internet Explorer with .NET 3.0 and in both Internet Explorer and Firefox with .NET 3.5.  
  • Runs on Windows machines only (Windows XP, Windows Server 2003, Windows Vista, and Windows Server 2008)
  • Richest functionality, including 3D graphics

Silverlight:

  • Ships independently
  • Runs in web browsers only (Internet Explorer, Firefox, Safari)
  • Runs on Windows or Mac operating systems (also on Linux via Moonlight, which is an open source implementation of Silverlight based on Mono)
  • Functionality is a subset of WPF’s feature set

When should you use each?  The maddening answer is (of course): it depends! 

WPF is a more mature technology and was designed with a richer feature set.  It also has the advantage of being able to run in a browser or as an installed Windows-Form-type app. 

Silverlight has a broader reach.  You can access Silverlight from many operating systems and web browsers

The most important reason to choose one over the other should be based on the intended audience for the application.  For example, if a corporation is designing an application for internal use only and every employee has Windows XP as the company standard OS, then go with WPF to leverage the richer feature set.  If a corporation is designing an external-facing website, then Silverlight is the better choice because potential customers can access the website from a variety of different operating systems and browsers. 

Posted in WPF / Silverlight | Tagged: , | Leave a Comment »

Deploying ASP.NET MVC

Posted by Ramani Sandeep on August 27, 2009

here are the useful articles that helps you in deploying MVC application on Remote Server / IIS with different version.

1. Bin Deploying ASP.NET MVC

With the release of ASP.NET MVC Beta, the assemblies distributed with ASP.NET MVC are automatically installed into the GAC.

  • System.Web.Mvc
  • System.Web.Routing
  • System.Web.Abstractions

While developing an application locally, this isn’t a problem. But when you are ready to deploy your application to a hosting provider, this might well be a problem if the hoster does not have the ASP.NET MVC assemblies installed in the GAC.

Fortunately, ASP.NET MVC is still bin-deployable. If your hosting provider has ASP.NET 3.5 SP1 installed, then you’ll only need to include the MVC DLL. If your hosting provider is still on ASP.NET 3.5, then you’ll need to deploy all three. It turns out that it’s really easy to do so.

Click here to read more….

 

2. ASP.NET MVC on IIS 6 Walkthrough

I’ve seen a lot of reports where people have trouble getting ASP.NET MVC up and running on IIS 6. Sometimes the problem is a very minor misconfiguration, sometimes it’s a misunderstanding of how IIS 6 works.

In this post, I want to provide a definitive guide to getting ASP.NET MVC running on IIS 6. I will walk through using the .mvc or .aspx file extension for URLs first, then I will walkthrough using extension-less URLs.

If you’re running into problems with IIS 6 and ASP.NET MVC, I recommend trying to walk through all the steps in this post, even if you’re not interested in using the .mvc or .aspx mapping. Some of the lessons learned here have more to do with how ASP.NET itself works with IIS 6 than anything specific to ASP.NET MVC.

Click here to read more….

 

3. Using ASP.NET MVC with Different Versions of IIS

In this tutorial, you learn how to use ASP.NET MVC, and URL Routing, with different versions of Internet Information Services. You learn different strategies for using ASP.NET MVC with IIS 7.0 (classic mode), IIS 6.0, and earlier versions of IIS.

Click here to read more….

Posted in ASP.NET MVC | Tagged: , , | Leave a Comment »

IQueryable vs IEnumerable

Posted by Ramani Sandeep on August 26, 2009

The primary difference is that the extension methods defined for IQueryable<T> take Expression objects instead of Functional objects, meaning the delegate it receives is an expression tree instead of a method to invoke.

IEnumerable<T> is great for working with in-memory collections, but IQueryable<T> allows for a remote data source, like a database or web service.

IEnumerable doesn’t have the concept of moving between items, it is a forward only collection. It’s very minimalistic; something that most any data source can provide. Using only this minimal functionality, LINQ can provide all of these great operators.

IQueryable<T> is a very powerful feature that enables a variety of interesting deferred execution scenarios (like paging and composition based queries).

Hope this helps !!!

Reference Links :

Posted in ASP.NET, ASP.NET MVC, Linq | Tagged: , , , | 2 Comments »

Entity Framework

Posted by Ramani Sandeep on August 26, 2009

The challenge of bringing data from efficient storage engines such as SQL Server into object-oriented programming models is hardly a new one. Most developers address this challenge by writing complex data access code to move data between their applications and the database. However, writing such code requires an understanding of the database, so that you can access data either from the raw tables, from views, or from stored procedures.

More often than not, databases are managed by DBAs whose job it is to ensure that the database is available, powerful, efficient, and secure. The means of accomplishing this generally take the data further out of the scope of your own concepts of how your data should be structured in your applications. It requires a solid knowledge of the database schema, table definitions, and stored procedures along with their parameters and results, views, keys, and more, so that you can create your data access code.

Entity-relationship modeling, introduced in the 1970s by Peter Chen, goes a long way toward solving this problem. Using entity-relationship modeling, programmers create a conceptual model of the data and write their data access code against that model, while an additional layer provides a bridge between the entity-relationship model and the actual data store. Most modeling, to date, gets done on a whiteboard.

With the ADO.NET Entity Framework, Microsoft has made entity-relationship modeling executable. They achieved this using a combination of XML schema files, behind the scenes code generation (creating .NET objects), and the ADO.NET Entity Framework APIs. The schema files define a conceptual layer to expose the data store’s (e.g., a SQL Server database) schema, and to create a map between that and your application-level objects. The ADO.NET Entity Framework allows you to write your programs against classes that are generated from this conceptual layer. The Framework then handles all the required translation as you extract data from the database and send it back in.

Figure 1: How the different layers of the Entity Data Model fit into your application.

This article provides an explanation of the basic concepts of ADO.NET Entity Framework, gives you an opportunity to get your hands dirty with code, and provides a glimpse into the possibilities that ADO.NET Entity Framework opens up for developers.

 

Click to read more…..

Posted in ADO.NET, ASP.NET, ASP.NET MVC | Tagged: , | Leave a Comment »

Dependency Injection Frameworks

Posted by Ramani Sandeep on August 26, 2009

Performing manual dependency injection (like we are above) works fine, but does become harder to maintain as the number of dependencies and components in an application increases.

Several dependency injection frameworks exist for .NET that can help provide even more dependency management flexibility.

These frameworks, also sometimes called “Inversion of Control” (IoC) containers, provide mechanisms that enable an additional level of configuration support for specifying and passing dependencies to objects at runtime (most often using constructor injection).

Some of the more popular OSS Dependency Injection / IOC frameworks in .NET include:

  1. AutoFac
  2. Ninject
  3. Spring.NET
  4. StructureMap
  5. Windsor

ASP.NET MVC exposes extensibility APIs that enable developers to participate in the resolution and instantiation of controllers, and which enables Dependency Injection / IoC frameworks to be cleanly integrated within this process.

Posted in ASP.NET MVC | Tagged: , , , , , | Leave a Comment »

What is PageGlimpse ?

Posted by Ramani Sandeep on August 26, 2009

PageGlimpse is a service providing developers with programatic access to thumbnails of any web page. The thumbnails can be virtually used in any kind of applications that require the display of website screenshots: web sites, windows/linux/mac applications, iPhone/mobile utilities, browser plugins, etc.

Including web site thumbnails in your application will dramatically improve the user experience. The service is easy to use, fast and reliable, no restriction on thumbnail sizes or number of hits. Click here to see how it works.

 

Click here for more info……

Posted in Mics | Tagged: , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 317 other followers