Jan 07

I love reading great articles! The one I am posting today is simply deep and marvelous! Its written by the well known Jeff Prosise and is included in the last issue of MSDN Magazine.
In this article Jeff explains how to use drag and drop using ASP.NET Ajax Extensions with new Visual Studio. Here is a small part of it, at the end there is a link to the whole article:

AJAX has revolutionized Web user interfaces, and ASP.NET AJAX has made AJAX available to the Visual Studio® users. It comes in three separate downloads: ASP.NET AJAX Extensions (asp.net/ajax/downloads), which provides the core, fully tested set of AJAX functionality; ASP.NET AJAX Futures (asp.net/downloads/futures), which contains experimental features on which the product group wants feedback; and the ASP.NET AJAX Control Toolkit (asp.net/ajax/ajaxcontroltoolkit/samples), which provides a grab bag of AJAX controls as well as an SDK for building controls of your own.

Of the three, the Futures release has garnered the least attention from the developer community. That’s unfortunate because, more than providing a glimpse into what future versions of ASP.NET AJAX might look like, the Futures Community Technology Preview (CTP) is chock full of features that can be used to build cutting-edge Web apps today. A case in point is drag-and-drop.

Hidden away inside the Futures PreviewDragDrop.js file lies support for rich, browser-based drag-and-drop user interfaces. The model it uses is patterned after the old OLE drag-drop model, in which drag sources implement the IDragSource interface, drop targets implement the IDropTarget interface, and the system provides a drag-drop manager to connect drag sources to drop targets. The Futures drag-drop manager is an instance of a JavaScript class named Sys.Preview.UI._DragDropManager, which is automatically instantiated and made available through a global variable named Sys.Preview.UI.DragDropManager.

For months now, I’ve been meaning to write a sample showing how to use PreviewDragDrop.js to implement real drag-drop, featuring custom drag sourcing and custom drop targeting. I finally got around to it, and the results are pretty cool. I learned quite a lot about DragDropManager in the process, including how to enhance it by adding support for custom drag visuals. Once you’re familiar with the model (and comfortable with the concept of deriving classes and implementing interfaces in JavaScript), DragDropManager opens up a whole new world of possibilities for Web UIs.
read original

Dec 10

Few days ago from Microsoft released ASP.NET 3.5 Extensions CTP Preview. This release brings additional runtime functionality to ASP.NET and .NET 3.5. You can download it here.

Here is what this release includes:

* ASP.NET AJAX Improvements: New ASP.NET AJAX features in the ASP.NET 3.5 Extensions release include better browser history support (back/forward button integration, and server-side history management support), improved AJAX content linking support with permalinks, and additional JavaScript library improvements.

* ASP.NET MVC: This model view controller (MVC) framework for ASP.NET provides a structured model that enables a clear separation of concerns within web applications, and makes it easier to unit test your code and support a TDD workflow. It also helps provide more control over the URLs you publish in your applications, and more control over the HTML that is emitted from them.

* ASP.NET Dynamic Data Support: The ASP.NET 3.5 Extensions release delivers new features that enable faster creation of data driven web sites. It provides a rich scaffolding framework, and will enable rapid data driven site development using both ASP.NET WebForms and ASP.NET MVC.

* ASP.NET Silverlight Support: With the ASP.NET 3.5 Extensions release we’ll deliver support for easily integrating Silverlight within your ASP.NET applications. Included will be new controls that make it easy to integrate Silverlight video/media and interactive content within your sites.

* ADO.NET Data Services: In parallel with the ASP.NET Extensions release we will also be releasing the ADO.NET Entity Framework. This provides a modeling framework that enables developers to define a conceptual model of a database schema that closely aligns to a real world view of the information. We will also be shipping a new set of data services (codename “Astoria”) that make it easy to expose REST based API endpoints from within your ASP.NET applications.

read more

Dec 03

I have severe lack of time so thats the reason to blog about the following posts in one short notice. Few weeks ago I came across Matt Berseth’s blog and made me quite good impression. He blogs frequently and providing quality posts. His last two I liked a lot.

The first one was about how to create image reflections. He describes three practices:

- Browser Specific Client Side Solution
- Cross Browser Client Side Solution
- Cross Browser Server Side Solution

Which one we choose is a matter of what we really want - rendering time or support for all browsers.

Then he wrote about my favourtite IDE - Visual Studio 2008. Matt described how we can use the new ListVew control plus adding DataPager control and extend it with SliderExtender Control from AjaxControlToolkit.

This post is provided with demo and source code for download. Thanks Matt!

Nov 19

Today Microsoft shipped Visual Studio 2008 and .NET 3.5. You can download the final release using one of the links below:

* If you are a MSDN subscriber, you can download your copy from the MSDN subscription site (note: some of the builds are just finishing being uploaded now - so check back later during the day if you don’t see it yet).

* If you are a non-MSDN subscriber, you can download a 90-day free trial edition of Visual Studio 2008 Team Suite here. A 90-day trial edition of Visual Studio 2008 Professional (which will be a slightly smaller download) will be available next week. A 90-day free trial edition of Team Foundation Server can also be downloaded here.

*If you want to use the free Visual Studio 2008 Express editions (which are much smaller and totally free), you can download them here.

* If you want to just install the .NET Framework 3.5 runtime, you can download it here.

List of New Features - old version

- VS 2008 Multi-Targeting Support
VS 2008 enables you to build applications that target multiple versions of the .NET Framework. This means you can use VS 2008 to open, edit and build existing .NET 2.0 and ASP.NET 2.0 applications (including ASP.NET 2.0 applications using ASP.NET AJAX 1.0), and continue to deploy these application on .NET 2.0 machines.

- ASP.NET AJAX and JavaScript Support
.NET 3.5 has ASP.NET AJAX built-in (no separate download required). In addition to including all of the features in ASP.NET AJAX 1.0, ASP.NET 3.5 also now includes richer support for UpdatePanels integrating with WebParts, ASP.NET AJAX integration with controls like and , WCF support for JSON, and many other AJAX improvements.

- VS 2008 Web Designer and CSS Support
VS 2008 and Visual Web Developer 2008 Express includes a significantly improved HTML web designer (the same one that ships with Expression Web). This delivers support for split-view editing, nested master pages, and great CSS integration.

- Language Improvements and LINQ
The new VB and C# compilers in VS 2008 deliver significant improvements to the languages. Both add functional programming concepts that enable you to write cleaner, terser, and more expressive code. These features also enable a new programming model we call LINQ (language integrated query) that makes querying and working with data a first-class programming concept with .NET.

- Data Access Improvements with LINQ to SQL
LINQ to SQL is a built-in OR/M (object relational mapper) in .NET 3.5. It enables you to model relational databases using a .NET object model. You can then query the database using LINQ, as well as update/insert/delete data from it. LINQ to SQL fully supports transactions, views, and stored procedures. It also provides an easy way to integrate business logic and validation rules into your data model.

- Browsing the .NET Framework Library Source using Visual Studio

Lots of other improvements

The list above is only a small set of the improvements coming. For client development VS 2008 includes WPF designer and project support. ClickOnce and WPF XBAPs now work with FireFox. WinForms and WPF projects can also now use the ASP.NET Application Services (Membership, Roles, Profile) for roaming user data.

Office development is much richer - including support for integrating with the Office 2007 ribbon, and with Outlook. Visual Studio Tools for Office support is also now built-into Visual Studio (you no longer need to buy a separate product).

New WCF and Workflow projects and designers are now included in VS 2008. Unit testing support is now much faster and included in VS Professional (and no longer just VSTS). Continuous Integration support is now built-in with TFS. AJAX web testing (unit and load) is now supported in the VS Test SKU. And there is much, much more…

Installation Suggestions

People often ask me for suggestions on how best to upgrade from previous betas of Visual Studio 2008. In general I’d recommend uninstalling the Beta2 bits explicitly. As part of this you should uninstall Visual Studio 2008 Beta2, .NET Framework Beta2, as well as the Visual Studio Web Authoring Component (these are all separate installs and need to be uninstalled separately). I then usually recommend rebooting the machine after uninstalling just to make sure everything is clean before you kick off the new install. You can then install the final release of VS 2008 and .NET 3.5 on the machine.

Once installed, I usually recommend explicitly running the Tools->Import and Export Settings menu option, choosing the “Reset Settings” option, and then re-pick your preferred profile. This helps ensure that older settings from the Beta2 release are no longer around (and sometimes seems to help with performance).

Note that VS 2008 runs side-by-side with VS 2005 - so it is totally fine to have both on the same machine (you will not have any problems with them on the same box).

Silverlight Tools and VS Web Deployment Project Add-Ins

Two popular add-ins to Visual Studio are not yet available to download for the final VS 2008 release. These are the Silverlight 1.1 Tools Alpha for Visual Studio and the Web Deployment Project add-in for Visual Studio. Our hope is to post updates to both of them to work with the final VS 2008 release in the next two weeks. If you are doing Silverlight 1.1 development using VS 2008 Beta2 you’ll want to stick with with VS 2008 Beta2 until this updated Silverlight Tools Add-In is available.

Read Scott Gu

Oct 22

Това са няколко често срещани случая когато употребата на Ajax e неуместна. Или поне трябва да се замислим преди да започнем разработването. Списъкът не е пълен, нито изчерпателен. Нека всеки който иска да добави нещо към него да напише коментар, после ще бъде добавен.

1. Използването на Ajax, само защото е Ajax

Използването на Ajax e модерно, но да не забравяме че е инструмент, а не играчка. Наистина трябва да се обмисли предварително къде и как да се използва.

2. “Back” бутона става неизползваем

За съжаление ‘Back’ бутона на всеки браузър не се разбира добре с Java Script. Това е една основателна причина върху която да се замислим преди да напишем едно приложение изцяло работещо на клиента.

Същестувават известни ‘workaround’ методи за този проблем, но засега нищо не е 100% работещо.

Все пак трябва да имаме предвид, че всеки модерен дизайн трябва да позволява връщане назад и със стандартни линкове и препратки.

3. Индикация когато нещо се прави(зарежда)

Ако нещо което натисна активизира Ajax, то аз искам да има индикация на екрана, че нещо се случва. Типичен пример е GMail с малката червна кутия в горния десен ъгъл.

4. Сигурността на Ajax приложенията

Когато използваш асинхронен метод за трансфер на данни, сигурността на тези данни трябва да е първото нещо за което да се помисли!

5. Невъзможността да запазиш страницата на компютъра си

Доста потребители все още ползват бавна интернет връзка с която те отварят търсената страница и я запазват на компютъра си. При повторно отваряне на запазената страница често се случва информацията да не е записана.

6. Мулти-платформеността на Ajax

За да използваш Ajax, трябва да познаваш Java Script доста добре. Разликите между различните Java Script имплементации обаче са всеизвестни. Не е достатъчно да пишеш по Java Script стандартите, а трябва и да се тества на всевъзможни браузъри.

7. Твърде много код забавя браузъра

Ajax предоставя възможност за доста по-интересни приложения, но всяка ‘екстра’ си има цена. В случая става въпрос за нуждата от мощен процесор. В миналото именно това беше основния недостатък да се използват богати Java Script сайтове. Но дори сега с напредналия хардуер проблемът си остава.

8. Когато не оставяме избор на хората без Java Script

Според последните проучвания на W3 schools, потребителите които нямат Java Script са някъде към 11% от всички. Ако твоят сайт се основава изцяло на Java Script това означава, че си ‘отрязал’ една десета от потенциалните си потребители.

9. Мигането и промяната на части от страницата неочаквано

А-то в Ajax идва от асинхронен. Проблемът при асинхроните съобщения е, че могат да се появяват неочаквано и да са доста объркващи.

10. Невъзможноста да изпращаме директни линкове към страниците

Всеки от нас е свикнал да изпраща линкове от страници на своите приятели и е сигурен, че те виждат това което и той. Сега обаче ситуацията се промени. В момента който страниците не са генерирани на сървъра съдържанието им остава само в потребителския браузър. Доста от новите сайтове създадоха специални “permalinks” секции именно заради този пробелм.

11. Блокиране на търсачките

Ajax страниците могат да съдържат огромно количество текст без да презареждат. Това малко напомня на горния проблем, нали  За да бъде правилно идексирана дадена страница, търсачките трябва да прочетат статичен HTML.

12. Character sets

Голям недостатък на Ajax приложенията е липсата на поддръжка на character sets. Винаги трябва да обозначаваме кой сет използваме на сървъра, както и кой се използва от Java Script на клиента. Напоследък се е наложил UTF-8 като универсален, защото поддържа доста езици.

13. Измислянето на нови правила за ползването на сайт

Принципът на ‘кликни и задръж с бутона на мишката този div, после го влачи и пусни на друго място’, работи добре за Ajax приложенията. Но определно не е универсален в интернет, което може да е объркващо.

14. Съобщаването за проблеми

В стандартните страници наличието на проблем е очевидно. При страниците генрирани на клиента обаче е възможено дори да не забележите, че нещо се е объркало освен ако нямате подходящ код.

Oct 16

We’re all living on the web, and we all seem to be starting our own websites, so it’s time we all learned the languages that make it run. The guys at Mashable.com have gathered over 250 resources to help you get going.

This list is aggregated from previous Mashable posts.

The list is quite extensive and features many ajax libraries, loading indicators etc so its best to be viewed at the original place.

Oct 11

XMLHttpRequest is not the only way to implement Ajax - in fact it is not even the most popular one. Take a quick look at the various transport methods in Ajax…

XMLHttpRequest

This is the W3C standard - most modern browsers supports this - browsers like…

* Firefox
* Opera
* Konquror
* Internet Explorer 7
* etc.

ActiveX(XMLHTTP)

This is the preferred method in Internet Explorer. Currently this is the most used method for ajax calls - due to the simple fact that IE has the majority market share. This is basically a different name for XMLHttpRequest - except for the initilization, all the API calls are the same as in XMLHttpRequest(thank God for that).

IE did not have a native XMLHttpRequest object(dispite the fact that they invented the concept). XMLHttpRequest was first introduced to the world as an ActiveX control in Internet Explorer 5.0. Fortunatly, they have native support for XMLHttpRequest from IE 7 onwards.

IFrame

This is used as a fallback for older browsers by some ajax libraries. In this method you load the URL in a (typically) hidden iframe element. Once the iframe has compleated loading, you can read the contents of the iframe. That way, you have a working Ajax system even in very old browsers.

One of the main advantages of this method is that it does not have the cross-domain issue(also known as the same origin restriction).

Image Source

This is not a popular transfer method - in fact, I have seen it in use only once. The basic concept is that you can point an image’s src to a server-side script. That script can do the necessary operation on the server and then return the image.

The major disadvantage of this method is that data can only be passed to the server - the server cannot pass data back to the client. Well, it is possible - if you set a cookie on the server and then read it in the client side. Trust me, you don’t need that kind of headaches - Ajax development is enough trouble as it is.

But it has a few advantages too…

* No cross domain issue
* Works with old browsers

Script Tag

This uses the same principle as the Image method - the only difference is that you use a script instead of an Image tag. That way, the server can return data to the client side as well.

This is a very popular method in the mashup scene. The main reason is this method don’t have the cross domain issue. For example del.icio.us offers this as a choice to get data from their site.

This method is also possible using a stylesheet - but I don’t want to go into that.

Non Javascript methods
Flash

Flash can be used to get data from the server and pass it to the javascript code.

Java Applets

I am sure that Java Applets can be used for this too - can anyone confirm this?

read source

Oct 01

Ajax and Javascript resources

You probably remember MiniAjax about which I posted way back in March.
Well now I finally got the chance to update with two not really new, but must visit web sites. The first one is AjaxRain.com, the site dedicated to aggregating Ajax, JavaScript and RIA controls & libraries. On the web site it says that should contain 755 + Ajax/Javascript/Dhtml examples and demos to download.

The second one is WebAppers - Only the Best and Free Resources for Web Application Developers. This one also contains significant amount of controls and plugins segmented into different categories.

Aug 28

Recently I came across this piece of software, it a solitaire game build on top of YUI. It is developed by Robert Schultz and over here you can read an interview with him.
Here is the game itself.

Aug 20

Scott Guthrie again shows one of the new feature of the new Visual Studio 2008 which is the improved designer support for ASP.NET AJAX Control Extenders.

What are ASP.NET Control Extenders?

ASP.NET Control Extenders are controls that derive from the System.Web.UI.ExtenderControl base class, and which can be used to add additional functionality (usually AJAX or JavaScript support) to existing controls already declared on a page. They enable developers to nicely encapsulate UI behavior, and make it really easy to add richer functionality to an application.

The ASP.NET AJAX Control Toolkit is a great example of a project that takes advantage of this control extender functionality. It includes more than 40+ free control extenders that you can easily download and use to add AJAX functionality to your applications.

For example, let’s assume we wanted to have a textbox on a page where a user could enter a date:

If the browser has JavaScript enabled, we might want to have a nice client-side calendar date picker appear when the user sets the focus on the date textbox to help with selecting the date:

Enabling this is trivial using the ASP.NET AJAX Control Toolkit. Just add the “CalendarExtender” control that ships with it to the page and point its “TargetControlID” property at the :

The CalendarExtender now automatically emits an ASP.NET AJAX javascript client script that adds the client-side calendar behavior to the TextBox at runtime. No additional code is required.


Using ASP.NET AJAX Control Extenders in VS 2008

With VS 2005 you had to manually wire-up control extenders yourself (either via source-view or via the property grid).

VS 2008 makes it even easier to discover and attach control extenders to your controls.
read original

TopOfBlogs