Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

October 22 2013

16:03

Microsoft lavora a un prototipo alternativo ai Google Glass

Secondo il Wall Street Journal, Microsoft starebbe lavorando a un prototipo di occhiali simili ai Glass di Google. A rivelarlo è una fonte anonima, interna alla società, che avrebbe una certa familiarità col progetto. L’iniziativa evidenzia il progressivo e controverso sforzo di Microsoft nell’evolversi da un’azienda che produce essenzialmente software a una che produce anche dispositivi hardware.

Dopo l’acquisto di Nokia per 7 miliardi di dollari e il lancio della seconda generazione di Surface, i gadget indossabili rappresentano la prossima frontiera di Microsoft. Secondo una recente ricerca di ABI Research le vendite dei cosiddetti wearable devices rappresenteranno una fetta di mercato appetitosa nell’ambito dei gadget tecnologici che raggiungerà le 485 milioni di unità entro il 2018.

Mentre sale l’attesa per i Google Glass che dovrebbero arrivare per la seconda metà del 2014, sempre secondo la fonte, non è detto che gli occhiali di Microsoft raggiungano la produzione di massa.

July 21 2013

13:32

Microsoft Surface Pro recensione e impressioni d’uso

surface
SURFACE PRO
Molto più di un tablet

A maggio dello scorso anno, quando è stato presentato Surface, forse non avevamo ancora ben chiaro cosa fosse. Né noi potenziali clienti, né Microsoft stessa. Non chiamatelo tablet. Perché Surface si avvicina solo un po’ alla tipica idea dei tablet Android o dell’iPad. Surface Pro è un laptop a tutti gli effetti che unisce alla potenza e all’estrema portatilità del prodotto, l’interazione con l’ambiente operativo tramite touch screen.

surface-7
WINDOWS 8
Surface Pro esegue sia le app sul Windows Store che le classiche applicazioni desktop progettate per Windows 7

Processore Intel Core i5 di terza generazione con Intel HD Graphics 4000 e 4 GB di RAM

Dopo averlo utilizzato, ogni volta che torno al mio MacBook Pro ho la continua tentazione di toccare lo schermo per interagire con le funzionalità di alcuni programmi o per sfogliare le pagine Web. Da questo punto di vista, va riconosciuto a Microsoft uno sforzo importante nel tentativo di convergere il vecchio paradigma di interazione con mouse e tastiera e quello touch. Il risultato forse non è sempre entusiasmante, soprattutto quando si passa dall’interfaccia a piastrelle Modern UI di Windows 8 Pro a quella classica desktop, ma con buona probabilità diverrà uno standard nei prossimi anni in tutti i moderni sistemi operativi che verranno. Facendo due conti, l’ho quasi sempre usato più come “laptop” con tastiera che come tablet.

surface-2
CORPO
Dimensioni
27,5 x 17,3 x 1,3 cm
Peso 907 gr
Telaio VaporMg Color titanio scuro
Materiali costruttivi di livello. Schermo widescreen HD 16:9. Doppia fotocamera.

I materiali costruttivi sono di livello. Il telaio in VaporMG di color titanio scuro è resistente e dona al corpo un design elegante. Si può tenere comodamente tra le mani anche se, a causa dei suoi 907 grammi (quasi 3 volte un iPad) dopo un po’ le braccia accusano il fastidio del peso. Lo schermo widescreen da 16:9 con tecnologia ClearType full HD è nitido e offre colori brillanti e ben bilanciati. Per quanto riguarda le porte, Surface è dotato di una porta USB, uno slot per schede microSD e un’uscita video HD. Le due fotocamere, anteriore e posteriore, hanno una risoluzione HD da 702p. Diciamo pure che le foto non sono il punto di forza di questo device ma immagino che chi lo acquisti non lo prenda principalmente per questo genere di funzione.

surface-7
WINDOWS 8
Surface Pro esegue sia le app sul Windows Store che le classiche applicazioni desktop progettate per Windows 7

Processore Intel Core i5 di terza generazione con Intel HD Graphics 4000 e 4 GB di RAM

Le prestazioni di Surface Pro sono eccellenti. La risposta del sistema operativo al touch è immediata. Potete lavorarci come su un classico portatile e spassarvela con giochi molto divertenti come Halo Spartan Assault che, soprattutto per gli amanti della serie per Xbox, vi terranno inchiodati davanti allo schermo per ore. Word, Excel, PowerPoint, Outlook e OneNote sono un punto di forza non da poco. Vi permettono di sfruttare tutto il potenziale di Surface per creare e modificare documenti anche molto complessi. L’applicazione di Outlook 2013, nella sua essenzialità, è semplicemente fantastica per gestire e tenere ordinata la casella email.

surface-8
INPUT PENNA
Un vero quaderno digitale per scrivere come su carta i vostri appunti.

Una menzione speciale la merita la penna in dotazione. Rappresenta quanto di meglio esista nel mercato per scrivere su un dispositivo elettronico. E’ quasi come scrivere su carta. La penna in dotazione del Surface Pro, unita alla versatilità di OneNote, vi permette di utilizzare Surface come un blocco appunti a tutti gli effetti. La risposta alla scrittura è immediata e realistica. Il risultato a schermo è pressoché identico a quello che si avrebbe disegnando su un pezzo di carta con una penna. Potete utilizzare un classico righello per disegnare schemi e figure geometriche con precisione senza lasciare segni sul documento.

surface-3
CORPO
Il corpo del Surface Pro con il supporto posteriore per utilizzarlo come un laptop.
surface-5
CORPO
Dettaglio del connettore d’alimentazione

L’interfaccia desktop è quella classica a cui Microsoft ci ha abituati oramai da tempo. Peccato che le descrizioni delle funzioni e il testo in generale risultano davvero troppo piccoli per passare troppe ore davanti allo schermo. Se lo utilizzate in configurazione laptop, con la tastiera e il corpo poggiato sull’apposito sostegno posteriore, a causa dell’angolazione fissa dello schermo che non può essere regolata come nei classici laptop, dovrete spostare la testa di continuo a seconda delle condizioni di luce. Alle volte, soprattuto con una fonte di luce alle vostre spalle, vi costringe a fare contorsioni che rendono questa soluzione non troppo comoda. Magari sarebbe stato meglio consentire al supporto posteriore una regolazione a tre o più livelli, in maniera da regolare l’angolazione dello schermo in casi simili. Un’ultima notazione per la batteria la cui durata in condizioni d’uso “stressanti” non supera le 4 ore.

surface-4
FOTOCAMERA
Dettaglio della LifeCam HD da 720p, anteriore con tecnologia TruColor
Comprarlo oppure no?

La domanda che in tanti mi hanno fatto è se vale la pena comprarlo oppure no. La risposta come al solito non può essere un brutale sì o no. Dipende molto da diversi fattori che bisogna ponderare a seconda delle esigenze dell’utente. Prima di tutto il prezzo. Il corpo del Surface Pro parte da 882 euro contro i 337 euro del fratello più piccolo, il Surface RT. Di sicuro se avete bisogno di qualcosa pratico come un tablet ma con cui poter lavorare ai classici strumenti di Office, allora la versione Pro può essere la scelta giusta. Di sicuro questo Surface non è uno strumento di puro intrattenimento come l’iPad. E se cercate qualcosa di meno impegnativo dal punto di vista delle funzionalità, forse più che la versione Pro, la versione RT è quella che fa al caso vostro.

La versione Pro da 128 GB costa 982 euro. A cui se sommate anche altri 119,99 euro della cover touch che funge da tastiera siete abbondantemente oltre i mille euro. Non sono pochi. Soprattutto considerando che sul mercato ci sono alternative con caratteristiche simili, incluso il touch screen, che potete trovare sui 400 euro. Sicuramente la qualità dei materiali e il cuore di questo Surface piazzano il prodotto a un livello molto superiore rispetto alla concorrenza, il che giustifica in parte il prezzo così elevato. Ma mi rendo conto che in termini assoluti non sono pochissimi.

surface-9
VOTO
7.5

In definitiva Surface Pro è un buon prodotto. Forse per certi aspetti snobbato ingiustamente dal mercato un po’ per la fredda accoglienza generale di Windows 8, un po’ a causa del prezzo, un po’ perché Microsoft ha comunicato questo prodotto confondendo i clienti che non hanno ben capito cosa fosse. Di sicuro rappresenta un buon punto di partenza per lo sviluppo di device simili nel prossimo futuro. Vale senza dubbio la pena provarlo.

Sponsored post
soup-sponsored
05:36
Reposted bySchrammelhammelMrCoffeinmybetterworldkonikonikonikonikoniambassadorofdumbgroeschtlNaitliszpikkumyygittimmoejeschge

May 07 2013

12:33

Microsoft, Bill Gates: «gli utenti iPad preferiscono Surface»

Che tutti i torti Bill Gates non ce li abbia, dobbiamo riconoscerglielo. Che l’iPad rispetto a un classico portatile sia molto limitativo è un dato di fatto. È pur vero che Steve Jobs aveva pensato il tablet per tutt’altro mercato e più di tanto non ci si poteva aspettare. Però l’appetito vien mangiando. Al touch screen alla fine c’abbiamo preso gusto. E l’idea di avere un PC ibrido, con le funzionalità di un desktop e la versatilità di un tablet non è proprio malaccio. Microsoft con Windows 8 e Surface ha provato a fare il grande salto. Il risultato non ha convinto granché.

19 giugno 2012: Steve Ballmer, CEO di Microsoft presenta Surface.

Steve Ballmer, CEO di Microsoft presenta Surface in una foto risalente a Maggio 2012

Windows 8 pare stenti a decollare e secondo gli ultimi dati diffusi da IDC, nel primo trimestre del 2013 Microsoft ha venduto appena 900mila tavolette tra Surface RT e Surface PRO. Nello stesso periodo, Apple ha venduto 19,5 milioni di iPad. Samsung 8,8 milioni. Asus 2,7 e Amazon 1,8 milioni. Per Microsoft, conti alla mano, non è proprio un gran successo. Corrisponde a circa l’1,8% di quota di mercato a livello globale.

In una recente intervista alla CNBC Bill Gates ha dichiarato:

«Molti utenti sono frustrati dall’iPad. Non possono creare documenti. Non hanno a disposizione Office. Con Surface stiamo fornendo agli utenti qualcosa che possa portare loro gli stessi benefici dell’utilizzo di un tablet senza rinunciare a quello che si aspettano da un PC».

Il proposito è più che ragionevole. È la messa in pratica che forse ha incontrato qualche inghippo. Surface è un buon prodotto. Ha patito però gli effetti di un ritardo nella commercializzazione e di una pessima distribuzione. Il prezzo poi, non è così user friendly rispetto a quello di un’iPad anche se c’è da ammettere che le funzionalità per le versioni PRO sono decisamente superiori a quelle del tablet di Apple.

Nonostante questo però l’appeal per i potenziali acquirenti resta ancora basso. Microsoft avrebbe speso solo per la campagna di marketing del prodotto qualcosa come 1,5 miliardi di dollari. Un’enormità rispetto ai risultati ottenuti. Forse un Surface più maturo sarà capace di convincere di più il mercato. Oppure, per com’è la situazione, tablet e PC continueranno a incarnare due mondi con bisogni differenti, difficilmente conciliabili.

April 11 2013

10:40

Crollano le vendite dei PC. La colpa? Della crisi globale e di Windows 8

Gli effetti della crisi globale si fanno sentire anche nel mercato dei personal computer. Le previsioni per i prossimi mesi sono cupe. Lo scorso anno si è registrato il dato peggiore da quando IBM ha presentato il primo computer desktop nel 1981. Il primo trimestre del 2013 è stato nerissimo con 76,3 milioni di unità vendute, pari al 14% in meno del trimestre gennaio-marzo 2012.

Hewlett-Packard, il più grande produttore di PC, ha visto crollare le vendite del 24% rispetto allo stesso periodo del 2012. Ormai da mesi nell’ambiente hi-tech si mormora che l’agonia dei PC sia irreversibile. Un po’ per la crisi, un po’ perché la stragrande maggioranza degli utenti consumer preferisce un più pratico tablet. Ma c’è anche un altro aspetto che ha contribuito a porre un freno significativo alle vendite. Ed è Windows 8.

Con l’ultima versione di Windows, Steve Ballmer, dopo aver perduto un decennio nell’innovare Microsoft, pensava di aver tirato fuori dal cilindro una così radicale rivoluzione che avrebbe fornito nuova aria a un mercato che stava già soffocando. Invece le cose sono andate per il verso sbagliato. Peggio di quanto chiunque sì immaginava potessero andare. Microsoft ha venduto appena 60 milioni di licenze di Windows 8. Troppo poche anche per il più ottimista di turno. E la cosa curiosa è che, nonostante siano passati 12 anni dal lancio, Windows XP continua a detenere ancora il 39,9% del mercato globale dei sistemi operativi ed è ancora profondamente radicato nell’ambito aziendale.

Windows 8 non piace. Bocciato sia dal mercato che dagli utenti. Bob O’Donnell, Vice Presidente di IDC, in una recente ricerca ha commentato che

«il lancio di Windows 8 non solo non ha fornito un impulso positivo al mercato PC ma anzi ne ha rallentato la crescita».

Nonostante qualche blando segnale positivo per i Windows Phone, se allo stato stagnante del mercato dei PC sommate il flop di Surface e i commenti circolati nei giorni scorsi secondo cui Microsoft potrebbe diventare irrilevante nei prossimi 4 anni, il quadro complessivo per il colosso di Redmond è assai poco esaltante e la poltrona su cui resta aggrappato Steve Ballmer si fa sempre più bollente.

April 05 2013

20:25

Rewind Episodio 10

IN QUESTO EPISODIO

Il primo episodio della nuova serie Rewind con Alice! Nella puntata di oggi:

Beppe Grillo serra i ranghi per arginare la fronda che preme per un’apertura al PD. Ai suoi: «Vengo giù e ci facciamo due carezze», LEGGI

38 anni fa nasceva Microsoft e segnò l’inizio della rivoluzione dell’informatica moderna, LEGGI

12:49

38 anni fa nasceva Microsoft e segnò l’inizio della rivoluzione dell’informatica moderna

Bill Gates nel 1975: «Nel futuro vedo un computer su ogni scrivania e uno in ogni casa»
Pare che la storia alle volte abbia delle strane coincidenze. Il 1° aprile 1976 Steve Jobs e Steve Wozniak fondarono la Apple Corporation. Un anno prima, il 4 aprile 1975, un’altra coppia storica aveva fondato la “Microsoft Corporation”. Erano Paul Allen e Bill Gates. Negli anni successivi con MS-DOS prima e Windows poi avrebbero cambiato per sempre l’informatica di largo consumo, diventando i pionieri della rivoluzione dei PC domestici. All’epoca Gates aveva vent’anni. Paul Allen ventidue. «Nel futuro vedo un computer su ogni scrivania e uno in ogni casa» sosteneva Gates nel 1975. Solo un pazzo o un visionario a quell’epoca poteva immaginare l’impatto travolgente che avrebbe avuto la diffusione dei computer nella nostra società. In tanti non gli credettero. Sappiamo tutti com’è finita.

Una foto di Bill Gates nei primissimi anni '80.

Una foto di Bill Gates nei primissimi anni ’80.

Dopo un ventennio di forte crescita ed espansione, dalla fine degli anni Novanta in poi Microsoft ha cominciato a perdere parte del suo appeal. A luglio dello scorso anno, un articolo comparso su Vanity Fair che ha avuto un’enorme risonanza accusava la sciagurata gestione del colosso di Redmond da parte dell’attuale CEO, Steve Ballmer, parlando di decennio perduto. Il recente flop delle vendite di Microsoft Surface e l’imperdonabile ritardo nel mercato dei sistemi operativi per smartphone hanno recentemente riacceso le polemiche. Appena qualche giorno fa su BusinessInsider è comparso un articolo che citava un report di Gartner secondo cui Microsoft potrebbe diventare completamente irrilevante nei prossimi quattro anni. Il futuro forse non brilla più come una volta e ricordare il passato rende questa evenienza un po’ meno amara.

March 29 2013

09:24

La rivincita dei Windows Phone: le vendite superano quelle dell’iPhone in 7 Paesi

È una specie di piccolo miracolo. Uno di quelli che forse neanche ti aspetti. Dopo il disastro delle vendite di Surface e anni di immobilismo nel mercato degli smartphone, con qualche flop di quelli sonori, arriva finalmente la rivincita di Microsoft. Risicata, per carità, ma che fa guardare con più ottimismo al futuro dei Windows Phone. Secondo quanto riportato ieri sul blog ufficiale della società di Redmond da Frank Shaw, capo delle Corporate Communication di Microsot, le vendite dei Windows Phone hanno superato quelle dell’iPhone in 7 Paesi: Argentina, India, Polonia, Russia, Sud Africa, Ucraina e Croazia.

Nonostante il numero complessivo dei Windows Phone venduti in questi Paesi sia relativamente contenuto, (in Ucraina e Sud Africa stiamo parlando in totale di circa 200mila unità), il trend positivo registrato da Microsoft è un segnale che nessuno, neanche Apple, sembra voglia più ignorare. L’espansione del mercato degli smartphone nei prossimi anni passerà inevitabilmente per i Paesi delle cosiddette “economie emergenti”, tra cui l’India dove Apple stenta a imporsi e le scelte dei consumatori sono più orientate verso alternative più low-cost rispetto ai costosissimi iPhone. Non a caso i rumors, ormai da mesi, parlano di un imminente lancio da parte di Apple di un iPhone “low-cost” proprio per aggredire una fascia di mercato meno di alto profilo rispetto a quella del classico iPhone. Chissà se Steve Jobs si starà rivoltando nella tomba. Ma i tempi cambiano e la crisi impone scelte diverse da quelle adottate fino ad oggi.

Secondo quanto riportato da Gartner, il mercato degli smartphone continua a godere di buonissima salute anche se nel 2012 c’è stata una lieve contrazione delle vendite dell’1,7% rispetto al 2011 con un totale di 1,71 miliardi di smartphone venduti. Nell’ultimo trimestre del 2012 le vendite hanno registrato un record storico toccando le 207,7 milioni di unità a livello globale con un incremento del 38,3% rispetto allo stesso periodo del 2011. Nello stesso periodo i Windows Phone hanno venduto 3,5 milioni di unità in più rispetto allo stesso trimestre del 2011 raggiungendo una quota di mercato del 3% contro il 69,7% di Android e il 20,9% di iOS.

Vendite globali smartphone per sistema operativo nell’ultimo trimestre 2012 (in migliaia di unità) – Fonte Gartner

Sistema Operativo

Q4 2012 (Unità)

Q4 2012 (%)

Q4 2011 (Unità)

Q4 2011 (%)

Android

144,720.3

69.7

77,054.2

51.3

iOS

43,457.4

20.9

35,456.0

23.6

Research In Motion

7,333.0

3.5

13,184.5

8.8

Microsoft

6,185.5

3.0

2,759.0

1.8

Bada

2,684.0

1.3

3,111.3

2.1

Symbian

2,569.1

1.2

17,458.4

11.6

Others

713.1

0.3

1,166.5

0.8

Total

207,662.4

100.0

150,189.9

100.0

March 22 2013

10:30

IE10 and Beyond: Unifying Touch and Mouse Made Easy with Pointer Events


  
microsoft-surface-w550

I often get questions from developers like, “with so many touch-enabled devices on phones and tablets, where do I start?” and “what is the easiest way to build for touch-input?” Short answer: “It’s complex.” Surely there’s a more unified way to handle multi-touch input on the web – in modern, touch-enabled browsers or as a fallback for older browsers. In this article I’d like to show you some browser experiments using MSPointers – an emerging multi-touch technology and polyfills that make cross-browser support, well less complex. The kind of code you can also experiment with and easily use on your own site.

March 21 2013

11:16

L’ennesimo flop di Microsoft: le vendite di Surface un disastro. Cresce il malumore degli investitori per la gestione Ballmer.

Microsoft e l’ennesimo insuccesso. Questa volta il boccone più amaro da mandar giù, assai difficile da far digerire agli azionisti che già da tempo mostrano insofferenza verso la gestione Ballmer. Le continue scelte sbagliate fatte negli ultimi otto anni hanno gettato molte ombre sul colosso del software di Redmond. Dal ritardo imperdonabile accumulato nel mercato dei sistemi operativi per smartphone, alle versioni di Windows che hanno riscontrato una fredda accoglienza parte degli utenti, fino al quasi ignorato mercato dei tablet. Con Windows 8 hanno provato a mettere una pezza a tutto. Il risultato non è stato granché entusiasmante.

Steven Sinofsky

Steven Sinofsky, ex capo della divisione Windows, durante la presentazione di Microsoft Surface a giugno del 2012. Sinofsky è stato licenziato dopo l’insuccesso di Windows 8.

A giugno dello scorso anno, quando Steve Ballmer presentò Surface, le attese del mercato verso il nuovo ibrido tablet-laptop di Microsoft erano piuttosto elevante. E’ bastato qualche mese, un posizionamento di prezzo troppo alto, la mancanza di applicazioni, una sciagurata politica di distribuzione che lo ha reso pressoché introvabile, per trasformarlo in uno dei flop più sonori degli anni recenti. Secondo un report targato Bloomberg, Surface non ha venduto neanche un milione e mezzo di unità. Meno di 1 milione per la versione RT e circa 400mila per la versione Pro. Ai fornitori ne avevano ordinati più di tre milioni. Le stime iniziali puntavano a piazzare nel mercato 2 milioni e mezzo di Surface solo nell’ultimo trimestre del 2012. A consuntivo, la situazione è più che disperata.

Giusto per fare un paragone, Apple nello stesso periodo ha venduto 22,9 milioni di iPad, per un totale di 128 milioni di unità a livello globale durante il 2012. Un disastro che mette assai poca allegria dalle parti di Microsoft. Senza contare che nel primo trimestre del 2013 le stime parlano di un crollo delle vendite dei laptop del 18%. Esattamente il doppio rispetto al trend degli anni passati. E questo per Ballmer è un altro problema non da poco, visto che le vendite delle licenze di Windows seguono anche l’influenza dell’andamento del mercato dell’hardware.

Microsoft Surface

Microsoft Surface

Insomma, per Microsoft pare non si prospetti un bell’anno. Chissà se Ballmer resisterà all’offensiva. O se con qualche colpo di mano, dopo le ripetute critiche che gli piovono contro da ogni dove e i forti malumori interni, non sarà costretto dopo l’ennesimo flop alla definitiva resa.

August 24 2012

02:33

Windows 8 HTML5 WinRT RSS reader app

WinJS is a JavaScript framework for Windows 8, and David Rousset uses it here to create a quick RSS reader. He shows how in a tutorial series. This first article shows the way to build a welcome screen that employs WinJS ListView control. Blend and CSS3 are employed. The second tutorial shows work on the detail view displayed after a click-on-item. This uses a transition animation. Time to go through the two tutorials is estimated at 30 minutes. Check out the Windows 8 HTML5 WinRT RSS reader app.

April 18 2012

13:00

Facebook Buys Instagram. How Will Microsoft React?

This is the link to the original article creator of this site, if this message appears to another site than 1stwebdesigner - Graphic and Web Design Blog - 1stwebdesigner is a design blog dedicated to bloggers, freelancers, web-developers and designers. Topics focus on web design and inspirational articles. it has been stolen, please visit original source then!

Instagram is a free photo editing and sharing application which was launched in October 2010. It allows its users to take photos and apply one of the many digital filters available, then share it on social networking websites like Facebook and Twitter. When the application was launched, it was only available for Apple mobile users (iPod, iPhone, iPad) but in April 2012 they made it available for Android as well. The application is being distributed for free via App Store and Google Play. Because of the application’s popularity, many social networks made modifications and tweaks on their websites for Instagram users because only after one year of existence, Instagram had 10 million users already.

About The Purchase

Image Source

On April 9, 2012, Facebook made an announcement regarding the upcoming purchase of Instagram. Instagram, with only 1 application, only 13 employees, is supposed to receive $1 billion in cash and stock. Until now, Instagram had only two rounds of funding, first in February 2011 when the company raised $7 million from a variety of investors and $50 million in the first week of April when the company was valued at $500 million. While these funding rounds, especially the first one, helped the company grow and expand, no one had ever expected this purchase to be worth $1 billion. While this may sound like the “purchase of the year” and there aren’t doubts it can be it, Facebook played very well. It is being said that Facebook itself, is worth $100 billion which is exactly one hundred times more than what they are going to pay for Instagram. While someone may think it is a lot for a company to give such a big sum when it only holds $10 billion in its hands, it isn’t exactly like that. Probably Facebook and specifically Mark Zuckerberg didn’t care much about the sum paid. Of course they won’t go insane and pay dozens of billions but keeping away such an amazing start-up from the hands of Google or Microsoft, is worth much more worth than the money they paid. It was probably thought by the “Big Daddies” that Instagram would be killed on its development road. Facebook has waited for a while before they decided to purchase Instagram, it’s most likely they’ve understood its real value only after the second “wave” of funding and after extending its market. We can remember the “Flickr Story” when in 2005, Yahoo (a prosperous company at that time) acquired Flickr , for only $30 million making it the most popular photo-sharing web site.

Microsoft At the Moment

Image Source

Over the years, Microsoft has been building a series of successful products, making the company stronger and stronger.. It survived many civil actions against it. However, even if it has been really stable and growing over the past decades, it now faces a few problems. In 2011, it has been reported that Microsoft, Dell and Intel combined are worth the same as Apple. This makes Microsoft leave the leader position on the technology market. Microsoft has always been recognized for its Windows operating system, it isn’t so successful with web products. The company tried a few products which only became stable but not phenomenal. Bing, their search engine, is well known for being stable and receiving a majority of its traffic from Internet Explorer users, who represent  52% as of 2011. Since 2007, they have renovated and updated their products, by releasing: Windows Vista, Widows 7, Windows Mobile and recently announcing the beta consumer preview of Windows 8. An unexpected move by Microsoft was done in May 2011, when the company decided to buy Skype. Skype was bought by Microsoft for $8.5 billion , the biggest purchase the company has ever made. A very large amount was indeed invested but probably having Skype under its wing, Microsoft will get on the top of the leaderboard soon. We only have to wait and see how Skype will evolve and what marketing strategy will be used by Microsoft to keep this product alive and attract more users to it.

Why Microsoft Doesn’t Buy Successful Web Companies

Image Source

We can see that Microsoft isn’t very successful at building web products if they aren’t associated in a way with its OS or big properties the company owns. That’s why the company should make the appropriate conclusions and with the financial possibilities it has, either investing a lot into themselves, so they could become the leaders again, or, begin buying successful web products and companies that will have success. Except Skype, Microsoft hasn’t bought anything very significant that would still be appropriate to show as an example, a few reasons this hasn’t happened are:

  • The Company Sees No Benefit in Spending More Money

I highly doubt this is the main reason why Microsoft didn’t please us with a revolutionary web product with the current value of approx. $200 billion. However, it could still be a reason. There aren’t any financial details how much was spent on developing the Windows 8 OS so we can’t rule out anything, at least for the time being.

  • There aren’t Opportunities on the Market

Well, this is more possible but still it depends on what the heads of Microsoft would like to aim at. While there aren’t any revolutionary ideas available for purchase, there are more possibilities in the social media sector. I suppose that Microsoft has an eye on both, Twitter and Pinterest. While Twitter is a more stable, day by day growing social network with a really unique idea, they may aim at Pinterest more because even though it was launched only in May 2010, it has become the third most visited social network, overtaking such networks like Tumblr, Google+ and LinkedIn. In my opinion, Pinterest isn’t a great business opportunity for Microsoft because it may fail in a year or two. I wouldn’t give Pinterest a longer lifespan than 3 or, at most, 4 years. Twitter has been around for a while, and while it’s been quietly killed by millions of spammers using Twitter for their benefit, a radical change in user policy and a better fight with the audience which isn’t using Twitter as it has to be used, can solve and make Twitter a very prosperous company.

  • They are Preparing their own Product

This is the most possible prediction I can think of. I think, they will be releasing a product to rock the web together with the new Windows 8. Its has been already said that Microsoft has success with almost every product related to its OS, so, why wouldn’t they use this benefit and release a web service really close to the new OS? They could even win some mobile audience if this service will be implemented as a primary one on the Windows mobile as well.

Microsoft, Twitter & Facebook and Instagram

I don’t believe Instagram is a big opportunity loss for Microsoft. For Twitter? Most likely, but not for Microsoft. Microsoft aims on software and products used by masses. I think a mobile photo sharing service wouldn’t interest Microsoft because of one important factor. They don’t have any acceptable space to use the respective service. Facebook will be using Instagram as an addition to its mobile version, as the current Facebook version for phones isn’t very well thought out and isn’t ready yet to be used by masses. Instagram will be the “final touch” which will encourage Facebook users to use the mobile version of the site more. I suppose Twitter was thinking about having a collaboration with Instagram, but definitely not buying it. Twitter can’t afford paying 1 billion for a photo-sharing company with the 2010 estimated revenue of 140 million dollars.

Conclusion

I believe Microsoft isn’t really worried about the recent acquisition of Instagram. Microsoft has other priorities at the moment and if they are not planning the release of any social network in the upcoming days, then, they don’t have much to lose with the loss of Instagram.

September 16 2011

16:17

Windows 8 Preview: A Developer Reflects

Its finally here. In June, we were given a taste of what Microsoft had in store for users and developers in Windows 8. And finally, after three long months, we have the developer release bits in our hands. Being the geek and developer I am, I wanted to get into the new OS, play with it, develop for it, and get a feel for what is to come.

Disclaimer: These are my own opinions of the OS as it is today. Keep in mind the Windows 8 Developer Preview is pre-beta software. It is buggy. It is not feature complete.


Setup

I imagine installation would take anywhere from fifteen to twenty minutes from optical media.

I installed Windows 8 on two machines, both with similar system specs. First is my laptop, a Dell Vostro 1500 with a Core2 Duo CPU, 4GB DDR2 RAM, 500GB HDD, and nVidia 8400 mobile graphics. The second machine is a little Dell Optiplex. It has the same specs, except a 2TB HDD and an ATi 2400 HD. The build I downloaded contained the development tools; it was too big to fit on a 4GB DVD, so I put the files on a USB thumb drive. Setup was a breeze, and very much akin to the Windows 7 installation process. The install process was about ten minutes; naturally, being installed from a USB drive had something to do with the speedy installation. I imagine installation would take anywhere from fifteen to twenty minutes from optical media.


The UI

After the installation completes, and if you’re dual-booting, you’ll find this new, Metrofied boot manager. Once you boot into Windows 8 for the first time, you’ll be prompted to enter either a Windows Live account or a regular Windows account name.

The new Windows 8 Boot Manager

You’ll then be taken to the new Metro Start screen.

Metro is Touchtastic

The Start screen is your new Start menu, so you will launch your apps from this new screen (the old Start menu is hidden away but can be resurfaced with registry tweaks).

Windows 8 is partitioned into two separate UIs: Metro and Desktop.

Metro apps cannot run in the classic Desktop UI, and Desktop apps cannot run in the Metro UI. You can, however, start Desktop apps from the new Start screen; Windows 8 transitions into the Desktop UI when you do so.

The Windows 8 Start Screen

I doubt we’ll see Office, Photoshop, Visual Studio, Quickbooks, or any other huge application on Metro anytime soon.

The obvious question is, “Why two UIs?” Metro is the touch UI. Apps written for the Metro UI are primarily going to be used in a touch environment for content consumption. The Desktop UI is there for backward compatibility, as well as for users who need the full power of Windows. I doubt we’ll see Office, Photoshop, Visual Studio, Quickbooks, or any other huge application on Metro anytime soon. Metro is more for consumption whereas Desktop is more for creation.

This is a developer preview; there is not a lot of fluff in this release. The purpose of this release is to get developers testing and learning the new platform. There are no Metro apps for mail and media in the preview, and the majority of apps installed on the OS are primarily for demonstration. Look to future betas and release candidates for more feature-complete previews of the OS.

I’ll come out and say this: I love Metro. I’ve loved it since playing with my mom’s Zune HD and using the Zune desktop app to sync my Zune. I have a Samsung Focus running Windows Phone 7, and I chose that platform primarily because of Metro. I use MetroTwit for my Twitter client, and look around for other Metrofied apps to look at and play with. So needless to say, I was excited to know that Microsoft is betting big on Metro. I’ve said, and still say, that WP7′s Metro UI is the best touch-based mobile UI currently available. While I do not have a touch device that I can install Windows 8 on, I have almost a year’s experience using the UI Windows 8′s Metro UI is based on (plus watching demo videos). The UI is responsive, and the gestures are intuitive. It is a fantastic touch experience, and touch users will feel right at home in the new Metro portion of the UI.

Metro is Craptastic for Mouse

Unfortunately, the Metro experience as currently implemented by Microsoft is horrible with a mouse.

Unfortunately, the Metro experience as currently implemented by Microsoft is horrible with a mouse. It’s not just the Start screen, but just about all aspects of the Metro experience. What do I mean by horrible? First, the UI is stretched horizontally, and Microsoft thought the best way to navigate these huge horizontal UIs was with scrollbars… really. It’s 2011, and Microsoft implements a touch-based UI for a mouse using scrollbars. You would think Microsoft would implement clicking and dragging to simulate touch (which I’ve witnessed several people try first), or make the UI move with the mouse’s movement (view the live demo of this Code Canyon item in a small window). But no… scrollbars. You can navigate the Start screen using the mouse’s scroll wheel (a plus), but none of the other Metro apps seemed to respond to the mouse wheel.

Second, the Charms (a unified set of functions for settings, sharing, search, etc that are provided by Windows for Metro apps) are activated by moving your mouse to the bottom left corner of the screen. Here’s how they look:

Windows 8 Charms

That in itself isn’t bad, but choosing one of the charms opens its panel on the right-hand part of the screen (as shown in the screenshot below). So you have to move your mouse to the other side of the screen to do whatever it is you wanted to do. I have not installed the Developer Preview on my main machine yet; so, I do not know how that behaves in a dual-monitor environment. But I assume users have to move their mouse across both monitors to do whatever it is they wanted to do with the chosen charm.

Settings pane in Metro apps

Third, zoom seems to be non-existent for mouse users. Touch-based zooming was demonstrated in Tuesday’s keynote, as well as the other sessions, but replicating zoom with a mouse ends in failure. I couldn’t zoom on the Start screen, and the only app I successfully zoomed in is the //Build/ app (with ctrl+mouse wheel).

That’s not to say Metro can’t be great with a mouse. There are many Metrofied applications available today for XP, Vista, and 7 (I mentioned a few above). When done right, Metro is awesome with a mouse. But unfortunately, the mouse experience currently in Windows 8’s Metro is not intuitive. It’s not natural. It’s horrible. I know it’s a Developer Preview, but I expected a lot more for mouse/keyboard users. I hope the mouse experience changes in the beta, especially since all Windows 8 users will have to use Metro.

Desktop Stays the Same (for the most part)

Not much has changed in the Desktop UI, although it did receive a small refresh. Gone are the rounded windows and buttons of XP, Vista, and 7; Windows 8′s windows and buttons return to the squared corners of Win9x and 2000.

Good 'ol Windows UI

There is also the ribbon in the Windows Explorer UI. I personally like the ribbon when used in the proper place. Windows Explorer always had a lot of options buried in menus and dialog boxes. The ribbon brings those options to the forefront, and I’m happy about that.

Final Thoughts on the UI

I am disappointed in the lack of customization of Metro.

I am disappointed in the lack of customization of Metro. While the lock screen can be customized, it seems the background of the Start screen cannot be changed. I hope that is just a feature missing from the Developer Preview.

I’ve always thought Apple had the right idea in separating the mobile OS from the desktop OS, but now I think Microsoft has the right idea in combining the two into one. I do, however, think they took the incorrect approach. While the Start screen is nice, fluid, and beautiful, it’s awkward switching between the two UIs when on a device other than a tablet. I would like to see an option to keep the classic Start menu while still being able to invoke the Metro Start screen at any time. As currently implemented, it is too much work to launch an app from the Desktop UI, but enhancing the mouse experience in the Metro UI would go a long way to making it easier and less cumbersome.


Development

Getting a peek at what’s to come is always something geeks like myself enjoy, but it was the Windows 8 developer story that kept me glued to the keynote. I am heavily invested in the C# language and .NET—be it either a desktop or web app, I write them in C# using the .NET stack. When Windows 8 was first previewed in June, .NET developers, myself included, were in a knee-jerk panic mode regarding our place in Windows 8 development. Metro apps written in HTML and JavaScript were showcased, yet nothing was mentioned regarding .NET. Microsoft’s lack of communication with their development community did nothing to sooth our fears.

Only a fool would think .NET would be suddenly killed in Windows 8, but the implication was that C#, Microsoft’s baby and highly touted language for the last ten years, was being pushed aside in favor of JavaScript/HTML and C++. Thankfully, that is not the case.

Quite naturally, the existing development model still exists for Desktop UI applications. Nothing has really changed there—except perhaps the decline of Silverlight. Metro is a different story; it’s where the new sexiness is. It doesn’t matter if you’re a C++ developer, a .NET developer, or a Web developer, Microsoft is providing the tools and (unified) APIs to write Metro apps. Microsoft is replacing the Win32 API for a new API called WinRT, and it is just as accessible in JavaScript as it is in C++.

But one of the most important concepts in Metro app development, and the one I’m most excited about, is the contract. Contracts are agreements between Windows and Metro apps to support a unified experience for the user. For example, apps that support the search contract open themselves up Windows 8’s search, enabling users to search those apps even when they are not running (or when the user is in another app). Other contracts are:

  • Sharing: shares content across apps or services
  • Play To: plays media on connected DLNA devices
  • Settings: provide context-specific access to settings that affect an app
  • App to App Picking: allows users to pick files from one app directly from within another app

The goal is to provide an experience that looks like one app, but in reality, its many different apps, glued together by Windows 8, working together to give the user the content they want. While it definitely means more work for me as a developer, it pays off with the rich experience users get when my app is installed.


Final Thoughts

Over all, I’m happy with how Windows 8 is shaping up. It’s a step in the right direction for a world filled with many types of devices and form factors. Microsoft definitely needs to work on the mouse experience in Metro—it’s just horrible. If they fix that, then Windows 8 will be fantastic on every device it runs on. I’m also pleased with the development story. We can essentially pick our preferred poison to write our Metro apps, and our apps can coexist in ways previously never seen before on Windows. For larger and more complex applications, we can still use the development model which, for me, is .NET with either WindowsForms or Windows Presentation Foundation (WPF).

Microsoft repeatedly said that Windows 8 is a reimagining of Windows, and it is true. They’re betting big, and it’ll pay off if they do it right.


August 31 2011

17:57

Google lancia Gmail Offline e annuncia Docs Offline

Google ha appena pubblicato sul Chrome Web Store la nuova applicazione Gmail Offline che consente di utilizzare il servizio di posta di Mountain View anche quando l’utente non è connesso ad internet.

L’app, che sfrutta le potenzialità del “localStorage” dell’HTML 5, permette di archiviare la posta ricevuta (ovviamente quella già scaricata), cercare ed organizzare i messaggi e le conversazioni, leggere e rispondere alle varie email anche in totale assenza di connessione.

A differenza di quanto accadeva fino ad oggi, dove era necessario essere connessi ad internet per caricare l’interfaccia di Gmail, Gmail Offline funziona come un classico client di posta elettronica, come Outlook o Apple Mail, ed è quindi sempre disponibile sia quando si è online che offline.

Google ha poi annunciato che, a breve, anche altre popolari applicazioni di Mountain View, come Calendar e Google Docs, saranno disponibili per l’utilizzo off-line con le stesse modalità già disponibili per Gmail Offline. In pratica sarà possibile elaborare testi, organizzare il calendario, riempire fogli di calcolo e realizzare presentazioni, stando comodamente “sconnessi” dalla rete per poi sincronizzare il tutto con il proprio account remoto non appena la connessione sarà di nuovo disponibile.

Questa scelta rientra nella strategia di Google di rendere le proprie applicazioni maggiormente diffuse e utilizzabili dagli utenti in qualsiasi condizione e non più solo strettamente legate alla disponibilità di una connessione ad Internet.

La sfida di Google a Microsoft e al suo Office 365, la versione cloud della suite di strumenti Office, si fa sempre più agguerrita e chissà se sarà proprio Mountain View a riuscire a scalfire il predominio che Microsoft, da più di un ventennio, detiene incontrastata nel mercato degli strumenti dell’office automation.

June 22 2011

20:58

The Ins and Outs of WebMatrix: An Introduction

Advertise here

This tutorial introduces Microsoft WebMatrix, a free web development technology that delivers one of the best experiences for web developers. For a PDF version of these tutorials and the complete sample code, go to the Microsoft Download Center.

What You'll Learn:

  • What is WebMatrix?
  • How to install WebMatrix.
  • How to get started creating a simple website using WebMatrix.
  • How to create a dynamic web page using WebMatrix.
  • How to program your web pages in Visual Studio to take advantage of more advanced features.



What is WebMatrix?

WebMatrix is a free, lightweight set of web development tools that provides the easiest way to build websites.

It includes IIS Express (a development web server), ASP.NET (a web framework), and SQL Server Compact (an embedded database). It also includes a simple tool that streamlines website development and makes it easy to start websites from popular open source apps. The skills and code you develop with WebMatrix transition seamlessly to Visual Studio and SQL Server.

The web pages that you create using WebMatrix can be dynamic—that is, they can alter their content or style based on user input or on other information, such as database information. To program dynamic Web pages, you use ASP.NET with the Razor syntax and with the C# or Visual Basic programming languages.

If you already have programming tools that you like, you can try the WebMatrix tools or you can use your own tools to create websites that use ASP.NET.

This tutorial shows you how WebMatrix makes it easy to get started creating websites and dynamic web pages.


Installing WebMatrix

To install WebMatrix, you can use Microsoft’s Web Platform Installer, which is a free application that makes it easy to install and configure web-related technologies.

  1. If you don't already have the Web Platform Installer, download it from the following URL:

    http://go.microsoft.com/fwlink/?LinkID=205867

  • Run the Web Platform Installer, select Spotlight, and then click Add to install WebMatrix.
    Install WebMatrix
  • Note   If you already have a WebMatrix Beta version installed, the Web Platform Installer upgrades the installation to WebMatrix 1.0. However, sites you created with earlier Beta editions might not appear in the My Sites list when you first open WebMatrix. To open a previously created site, click the Site From Folder icon, browse to the site, and open it. The next time you open WebMatrix, the site will appear in the My Sites list.


    Getting Started with WebMatrix

    To begin, you'll create a new website and a simple web page.

    1. Start WebMatrix.
      Start WebMatrix
    2. Click Site From Template. Templates include prebuilt files and pages for different types of websites.
      Create a Site
    3. Select Empty Site and name the new site Hello World.
    4. Click OK. WebMatrix creates and opens the new site.

      At the top, you see a Quick Access Toolbar and a ribbon, as in Microsoft Office 2010. At the bottom left, you see the workspace selector, which contains buttons that determine what appears above them in the left pane. On the right is the content pane, which is where you view reports, edit files, and so on. Finally, across the bottom is the notification bar, which displays messages as needed.

      [image]

    Creating a Web Page

    1. In WebMatrix, select the Files workspace. This workspace lets you work with files and folders. The left pane shows the file structure of your site.
      [image]
    2. In the ribbon, click New and then click New File.
      [image]

      WebMatrix displays a list of file types.

      [image]
    3. Select CSHTML, and in the Name box, type default.cshtml. A CSHTML page is a special type of page in WebMatrix that can contain the usual contents of a web page, such as HTML and JavaScript code, and that can also contain code for programming web pages. (You'll learn more about CSHTML files later.)
    4. Click OK. WebMatrix creates the page and opens it in the editor.
      [image]

      As you can see, this is ordinary HTML markup.

    5. Add the following title, heading, and paragraph content to the page:
      <!DOCTYPE html>
      <html lang="en">
      	<head>
      		<meta charset="utf-8" />
      		<title>Hello World Page</title>
      	</head>
      
      	<body>
      		<h1>Hello World Page</h1>
      		<p>Hello World!</p>
      	</body>
      </html>
    6. In the Quick Access Toolbar, click Save.
      [image]
    7. In the ribbon, click Run.
      [image]

      Note   Before you click Run, make sure that the web page you want to run is selected in the navigation pane of the Files workspace. WebMatrix runs the page that's selected, even if you're currently editing a different page. If no page is selected, WebMatrix tries to run the default page for the site (default.cshtml), and if there is no default page, the browser displays an error.

      WebMatrix starts a web server (IIS Express) that you can use to test pages on your computer. The page is displayed in your default browser.

      [image]

    Installing Helpers with the Administration Tool

    Now that you have WebMatrix installed and a site created, it's a good idea learn how to use the ASP.NET Web Pages Administration tool and the Package Manager to install helpers. WebMatrix contains helpers (components) that simplify common programming tasks and that you'll use throughout these tutorials. (Some helpers are already included with WebMatrix, but you can install others as well.) In the appendix you can find a quick reference for the included helpers and for other helpers that you can install as part of a package called the ASP.NET Web Helpers Library. The following procedure shows how to use the Administration tool to install the ASP.NET Web Helpers Library. You will use some of these helpers in this tutorial and other tutorials in this series.

    1. In WebMatrix, click the Site workspace.
    2. In the content pane, click ASP.NET Web Pages Administration. This loads an administration page into your browser. Because this is the first time you're logging into the administration page, it prompts you to create a password.
    3. Create a password.
      Package Manager

      After you click Create Password, a security-check page that looks like the following screen shot prompts you to rename the password file for security reasons. If this is the first time you're seeing this page, don't try to rename the file yet. Proceed to the next step and follow the directions there.

      Rename password file
    4. Leave the browser open on the security-check page, return to WebMatrix, and click the Files workspace.
    5. Right-click the Hello World folder for your site and then click Refresh. The list of files and folders now displays an App_Data folder. Open that and you see an Admin folder. The newly created password file (_Password.config) is displayed in the ./App_Data/Admin/ folder. The following illustration shows the updated file structure with the password file selected:
    6. Rename password file
    7. Rename the file to Password.config by removing the leading underscore (_) character.
    8. Return to the security-check page in the browser, and click the Click Here link near the end of the message about renaming the password file.
    9. Log into the Administration page using the password you created. The page displays the Package Manager, which contains a list of add-on packages.
      ch01_learnweb-14a

      If you ever want to display other feed locations, click the Manage Package Sources link to add, change, or remove feeds.

    10. Find the ASP.NET Web Helpers Library package. To narrow down the list, search for helpers using the Search field. The following image shows the result of searching for helpers. Notice that several versions of this package are available. 
      ch01_learnweb-14b
    11. Select the version that you want, click the Install button, and then install the package as directed. After the package is installed, the Package Manager displays the result. 
      ch01_learnweb-15

      This page also lets you uninstall packages, and you can use the page to update packages when newer versions are available. You can go to the Show drop-down list and click Installed to display the packages you have installed, or click Updates to display available updates for the installed packages.

      Note   The default website templates (Bakery, Calendar, Photo Gallery, and Starter Site) are available in C# and Visual Basic versions. You can install the Visual Basic templates by using the ASP.NET Web Pages Administration tool in WebMatrix. Open the Administration tool as described in this section and search for VB, and then install the templates you need. Website templates are installed in the root folder of your site in a folder named Microsoft Templates.

      In the next section, you'll see how easy is it is to add code to the default.cshtml page in order to create a dynamic page.


    Using ASP.NET Web Pages Code

    In this procedure, you'll create a page that uses simple code to display the server date and time on the page. The example here will introduce you to the Razor syntax that lets you embed code into the HTML on ASP.NET Web Pages. (You can read more about this in the next tutorial.) The code introduces one of the helpers that you read about earlier in the tutorial.

    1. Open your default.cshtml file.
    2. Add markup to the page so that it looks like the following example:
      <!DOCTYPE html>
      <html lang="en">
      
      <head>
      	<meta charset="utf-8" />
      	<title>Hello World Page</title>
      </head>
      
      <body>
      	<h1>Hello World Page</h1>
      	<p>Hello World!</p>
      	<p>The time is @DateTime.Now</p>
      </body>
      </html>

      The page contains ordinary HTML markup, with one addition: the @ character marks ASP.NET program code.

    3. Save the page and run it in the browser. You now see the current date and time on the page.
      Hello world with time

      The single line of code you've added does all the work of determining the current time on the server, formatting it for display, and sending it to the browser. (You can specify formatting options; this is just the default.)

    Suppose you want to do something more complex, such as displaying a scrolling list of tweets from a Twitter user that you select. You can use a helper for that; as noted earlier, a helper is a component that simplifies common tasks. In this case, all the work you'd otherwise have to do fetch and display a Twitter feed.

    1. Create a new CSHTML file and name it TwitterFeed.cshtml.
    2. In the page, replace the existing code with the following code:
      <!DOCTYPE html>
      <html lang="en">
      <head>
      	<meta charset="utf-8" />
      	<title>Twitter Feed</title>
      </head>
      
      <body>
      	<h1>Twitter Feed</h1>
      	<form action="" method="POST">
      		<div>
      			Enter the name of another Twitter feed to display: &nbsp;
      			<input type="text" name="TwitterUser" value=""/> &nbsp;
      			<input type="submit" value="Submit" />
      		</div>         
      
      		<div>
      			@if (Request["TwitterUser"].IsEmpty())
      			{
      				@Twitter.Search("microsoft")
      			}
      			else
      			{
      				@Twitter.Profile(Request["TwitterUser"])
      			}
      		</div>
      	</form>
      </body>
      </html>

      This HTML creates a form that displays a text box for entering a user name, plus a Submit button. These are between the first set of <div> tags.

      Between the second set of <div> tags there's some code. (As you saw earlier, to mark code in ASP.NET Web pages, you use the @ character.) The first time this page is displayed, or if the user clicks Submit but leaves the text box blank, the conditional expression Request["TwitterUser"].IsEmpty will be true. In that case, the page shows a Twitter feed that searches for the term "microsoft". Otherwise, the page shows a Twitter feed for whatever user name you entered in the text box.

    3. Run the page in the browser. The Twitter feed displays tweets with "microsoft" in them.
      Twitter page
    4. Enter a Twitter user name and then click Submit. The new feed is displayed. (If you enter a nonexistent name, a Twitter feed is still displayed, it's just blank.)

      This example has shown you a little bit about how you can use WebMatrix and how you can program dynamic web pages using simple ASP.NET code using the Razor syntax. The next tutorial examines code in more depth. The subsequent tutorials then show you how to use code for many different types of website tasks.


    Programming ASP.NET Razor Pages in Visual Studio

    Besides using WebMatrix to program ASP.NET Razor pages, you can also use Visual Studio 2010, either one of the full editions or the free Visual Web Developer Express edition. If you use Visual Studio or Visual Web Developer to edit ASP.NET Razor pages, you get two programming tools that can enhance your productivity—IntelliSense and the debugger. IntelliSense works in the editor by displaying context-appropriate choices. For example, as you enter an HTML element, IntelliSense shows you a list of attributes that the element can have, and it even can show you what values you can set those attributes for. IntelliSense works for HTML, JavaScript, and C# and Visual Basic (the programming languages you use for ASP.NET Razor pages.)

    The debugger lets you stop a program while it's running. You can then examine things like the values of variables, and you can step line by line through the program to see how it runs.

    To work with ASP.NET Razor Pages in Visual Studio, you need the following software installed on your computer:

    • Visual Studio 2010 or Visual Web Developer 2010 Express
    • ASP.NET MVC 3 RTM.

    Note   You can install both Visual Web Developer 2010 Express and ASP.NET MVC 3 using the Web Platform Installer.

    If you have Visual Studio installed, when you are editing a website in WebMatrix, you can launch the site in Visual Studio to take advantage of IntelliSense and the debugger.

    1. Open the site that you created in this tutorial and then click the Files workspace.
    2. In the ribbon, click the Visual Studio Launch button.
      Twitter page

      After the site opens in Visual Studio, you can see the site structure in Visual Studio in the Solution Explorer pane. The following illustration shows the website opened in Visual Web Developer 2010 Express:

      Twitter page

      For an overview of how to use IntelliSense and the debugger with ASP.NET Razor pages in Visual Studio, see the appendix item ASP.NET Web Pages Visual Studio.


    Creating and Testing ASP.NET Pages Using Your Own Text Editor

    March 14 2011

    16:52

    The Things Internet Explorer Got Right


    It’s the browser that everyone loves to hate—sometimes justifiably so. What was once the most innovative browser became the thorn in every front-end developer’s side. Amidst the turmoil and complaints today’s developers throw at Internet Explorer, what’s often not heard is how Microsoft changed the face of not only front-end development, but web development as a whole.

    IE’s fall is not an uncommon story; in fact, it’s somewhat the same story as Netscape. The company behind the leading browser grows complacent, the browser stagnates, and a new champion arises. It’s a repetitive cycle, one that Mozilla faces again to some extent (but that’s another story for another time).


    IE4’s Influence on the DOM

    Prior to the version 4 browsers, JavaScript was primarily used for simple data processing (form validation). As such, web pages were primarily static. While a page could be dynamically generated by server-side applications, the page could not interact with the user. This limitation existed because of the browser’s inadequate Document Object Model (DOM), which is the application programming interface (API) JavaScript developers use to access and manipulate individual elements in the page. The DOM that existed prior to the version 4 browsers is frequently referred to as DOM Level 0. DOM Level 0 implementations allow developers access to <form/>, <a/>, and <img/> elements, but that’s about it.

    “Microsoft is getting Internet Explorer back on track.”

    Netscape Navigator 4

    It wasn’t until Netscape released Navigator 4 (NS4) in mid-1997 that a browser’s DOM allowed web developers to alter a page with JavaScript. The technique of manipulating elements with JavaScript and the DOM was dubbed Dynamic HTML (DHTML). NS4’s DHTML was certainly a step forward, but its proprietary and ill-designed layer-based DOM and limited Cascading Style Sheet (CSS) support restricted developers in what they could actually accomplish.

    Accessing Elements

    Netscape did not implement a full object model. Aside from DOM Level 0 functionality, the only elements a developer could access were absolutely positioned elements, <layer/> elements, and <ilayer/> elements (the latter two elements were de facto positioned). Each of these types of elements were represented by a Layer object in NS4’s DOM. Netscape designed Layer objects to be very similar to frame (and thus window) objects. Each Layer object had a document property, which basically was another HTML document. Like frames, a Layer object could be nested in another Layer object, making code to access those layers extremely verbose like the following:

    var myLayer1 = document.layers["myLayerId"].document.layers["mySecondLayerId"];
    // or
    var myLayer2 = document.myLayerId.document.mySecondLayerId;

    These two lines of code do the same thing: they access the Layer object with an id of mySecondLayerId that is nested within a layer with an id of myLayerId. Yes, developers had to walk down the layer "tree" in order to access nested layers.

    Dynamic Content

    NS4’s DOM did not allow for the creation, insertion, relocation, and removal of DOM objects, but because each layer exposed a document object, a developer could dynamically change a layer’s content by using the write(), load(), and close() methods. While this gives some extra power to the layer model, it restricted developers in how they could dynamically update a page. New content would have to be written or loaded into a layer, effectively removing the layer’s existing content. Needless to say, most developers avoided content manipulation and instead focused on changing a layer’s style.

    Changing Style

    Web development using NS4’s DOM was painful and frustrating.

    But style in NS4’s DOM was a funny thing. While the browser supported CSS to some degree, Layer objects did not provide an API for developers to directly access a layer’s style attribute like today’s style object. Instead, Layer objects exposed a very limited set of properties that altered a layer’s position, visibility, clipping, and background color/image—nothing else, and the value these properties accepted were also quite limited. For example, the positioning and clipping properties only accepted numeric values; a developer could not specify a unit (such as px, em, pt, etc). An example of such code follows:

    var myLayer = document.myLayerId.document.mySubLayerId;
    myLayer.top = 10;

    Needless to say, web development using NS4’s DOM was painful and frustrating. NS4’s extremely limited DHTML capabilities stem from the limitations of NS4’s rendering engine (it could not reflow the page). But why spend so much time on Netscape’s DOM, especially in an article that’s supposed to be about IE? Had Netscape won the browser war, today’s DOM would be an evolutionary step from the DOM presented by Netscape in NS4. While today’s DOM is a standard put forth by the W3C (and some Netscape ideas are implemented in today’s standard), today’s DOM is heavily influenced by IE4’s DOM.

    IE4’s DOM

    Just a few months after Netscape released Navigator 4, Microsoft released the fourth version of IE. It, too, included support for DHTML, but Microsoft’s implementation was far different and superior to NS4. IE4 boasted much better CSS support and a more complete object model to access and manipulate elements and content in the page. The effect of IE4’s DOM was far reaching; in fact, a developer can find many similarities between IE4’s DOM and the standard DOM.

    Accessing Elements

    “Microsoft changed the face of not only front-end development, but web development as a whole…”

    IE4’s designers wanted to turn the browser into a platform for Web applications. So they approached IE4’s API like an operating system’s—providing a near complete object model that represented each element (and an element’s attributes) as an object that could be accessed with a scripting language (IE4 supported both JavaScript and VBScript).

    In IE4’s DOM, the primary means of accessing a particular element in the page was the proprietary all[] collection, which contained every element in the document. Developers could access elements with a numerical index or by specifying an element’s id or name, like this:

    var myElement1 = document.all["myElementId"];
    // or
    var myElement2 = document.all.myElementId;

    Using this code, developers could access the element object with an id of myElementId regardless of where it existed within the page. This is in stark contrast to Netscape’s layer model in which developers could only access layers through the layer’s hierarchy. The functionality of document.all["elementId"] evolved into the standard document.getElementById() method. But this wasn’t the only way a developer could access elements; one could walk the DOM tree and touch each element with the children[] collection and parentElement property—forerunners to the standard childNodes[] and parentNode properties.

    In addition to loading elements as objects, IE4’s DOM represented an element’s attributes as properties of the element object. For example, the id, name, and style properties mapped directly to an element’s id, name, and style attributes, respectively. This design became standard.

    Dynamic Content

    Microsoft invented the innerHTML property.

    Like Netscape, Microsoft did not provide a full-fledged API to dynamically add, move, and remove nodes with JavaScript. They did, however, invent the innerHTML property to get or set an element’s content. Unlike Netscape’s Layer object’s write() and load() methods, the innerHTML property was not an all-or-nothing solution to modifying an element’s content; a developer could use innerHTML to completely wipe out, replace, or add to an element’s content. For example, the following code gets an element’s content and modifies it:

    var el = document.all.myElementId,
        html = el.innerHTML;
    
    el.innerHTML = html + "Hello, innerHTML";

    To this day, the innerHTML property is a cornerstone of DHTML. It is an efficient means to adding large amounts of content to an element. Even though it has never formally been included in any DOM standard, every major browser implements an innerHTML property.

    Modifying Style

    Microsoft invented several tools and designs that evolved into pieces of the standard DOM, but the work they did with IE4’s style API became standard with very little modification. The key to changing an element’s style in IE4 was the style property, the same property (and syntax) used by developers today.

    DHTML changed web development forever. It was, however, IE4’s DOM that pushed the technology (and web development) forward by being the primary influence on the W3C’s DOM Level 1 and 2 specification. IE4 revolutionized web development in 1997, and IE would do so again a few years later.


    IE Revolutionizes Ajax

    Ajax blew the doors open for web development.

    Before Ajax was Ajax, it was called remote scripting, and developers leveraging the power of remote scripting used hidden frames and iframes for client-server communication. A hidden (i)frame usually contained a form that was dynamically filled out and submitted through JavaScript. The server’s response would be another HTML document containing JavaScript that notified the main page that data was received and ready to use. It was crude, but it worked.

    There was an alternative, however: a little known gem buried in Microsoft’s MSXML 2.0 library. IE5, released in March 1999, included MSXML 2.0, and developers found a component called XMLHttp (the actual interface name was IXMLHTTPRequest). Its name is misleading, as the XMLHttp object functions more like a simple HTTP client than anything else. Not only could developers send requests with the object, but they could monitor the requests’s status and retrieve the server’s response.

    Naturally, XMLHttp began to replace the hidden (i)frame technique for client-server communication. A couple of years later, Mozilla created their own object, modeled after Microsoft’s XMLHttp, and called it XMLHttpRequest. Apple followed suit with their XMLHttpRequest object in 2004, and Opera implemented the object in 2005.

    Despite its growing interest, the popularity of XMLHttp/XMLHttpRequest (collectively known as XHR here on out) didn’t explode until 2005 when Jesse James Garrett published his article, “Ajax: a New Approach to Web Applications.”

    Ajax blew the doors open for web development, and at the forefront was JavaScript, XHR, and DHTML—two of which were Microsoft’s inventions. So what happened? What caused a browser that literally changed how web developers write web applications to become the bane of the modern Web?


    Internet Explorer’s Fall

    By 2003, Internet Explorer’s total market share was around 95%; Microsoft officially won the browser war. With no real competition in the Web space, Microsoft shifted their focus from the browser to .NET. This is confirmed by quotes from many Microsoft employees, but the most telling is from a CNET article entitled “Will Ajax help Google clean up?” In it, Charles Fitzgerald, Microsoft’s general manager for platform technologies, was quoted as saying:

    “It’s a little depressing that developers are just now wrapping their heads around these things we shipped in the late 20th century [ed: DHTML and Ajax], but XAML is in a whole other class. This other stuff is very kludgy, very hard to debug. We’ve seen some pretty impressive hacks, but if you look at what XAML starts to solve, it’s a major, major step up.”

    So in May 2003, Microsoft announced that IE would no longer be released separately from Windows (the excellent IE5 for Mac was also canned). The browser would still be developed as part of the evolving Windows operating system, but Microsoft would not release any stand-alone versions of IE. They were betting primarily on ClickOnce, a technology that allows developers to write conventional applications (using .NET of course) and distribute them via the Web.

    But the Web continued to evolve in the path Microsoft originally set with IE4 and IE5, and Microsoft started to lose market share to Netscape’s heir: Firefox. Developers were writing web applications that lived in the browser, not in conventional applications via ClickOnce. That forced Microsoft to pick up IE, dust it off, and begin releasing stand-alone versions again.


    Microsoft Continues to Innovate

    IE9, includes much better standards support across the board.

    The next two versions, 7 and 8, were largely evolutionary. IE7 contained a variety of bug fixes, the XMLHttpRequest identifier (although it still created an XMLHttp object from the MSXML library), and improvements to the UI and security.

    IE8 was largely more of the same, except it sandboxed each tab—a feature that Google also implemented in Chrome (Microsoft announced it first). It isolates each tab in its own process, increasing security and stability. Sandboxing is becoming standard in today’s browsers (Firefox still lacks the capability), and it’s also moving into the realm of add-ons and plug-ins.

    Microsoft is getting Internet Explorer back on track.

    The latest version, IE9, includes much better standards support across the board, but it also innovates with its new JIT-compiling JavaScript engine (which uses a separate CPU core if available and can access the GPU) and its hardware-accelerated rendering engine. While JIT-compiling JavaScript engines are not new, IE9’s ability to offload compilation onto a separate core in parallel to the page rendering is an accomplishment that will spur on much needed performance for web applications. Its hardware-acceleration abilities proved useful when debuted, and now Firefox and Chrome offer hardware-acceleration to some extent.

    There is no denying that Internet Explorer has caused headaches for web developers. The five year lull between IE6 and IE7 caused Microsoft to fall way behind the competition, making front-end development less than ideal. But Microsoft is getting Internet Explorer back on track. They shaped web development to what it is today; here’s hoping they do so again.

    The next version of Internet Explorer, version 9, is scheduled to be officially released March 14th, 2011.

    November 17 2010

    19:56

    IE9 Chakra JavaScript Team Hosting a Q&A Session Tomorrow

    The IE9 team announced that they’ll be hosting an open Q&A session via Twitter where developers can ask questions to the Chakra engineers about the new JavaScript engine.

    In conjunction with the release of Platform Preview 7, we wanted to give the community the opportunity to ask questions of some of our IE and Chakra engineers. So we’re going to host a 2-hour Q&A chat on Twitter tomorrow morning beginning at 9am PST.

    They’ll be fielding questions starting tomorrow Thursday, November 18th from 9-11am PST and you can participate by sending your questions to @ie and using the hashtag #ie9.

    Check out the blog post for full details of the Q&A session.

    Full Disclosure: I work for Microsoft.

    November 10 2010

    16:04

    How to Build an RSS Feed with ASP.NET


    Over the course of this tutorial, we’ll review how to create an RSS Feed with the ASP.NET framework. Having an RSS feed for your site has become a necessity in recent years. With blogs or news sites being updated frequently, and with the vast amount of blogs and news websites out there, RSS has allowed readers to keep up with new content without being forced to visit them. Once you’ve completed this tutorial, you’ll know how to create an RSS feed with ASP.NET, and how to render XML documents on ASP.NET Web pages.


    Step 0: RSS 2.0 Introduction

    RSS is a web content syndication format. It stands for “Really Simple Syndication,” and is written in XML. All RSS files must conform to the XML 1.0 specification, as published by the World Wide Web Consortium (W3C). With RSS, it is possible to distribute up-to-date web content from one web site to thousands of others around the world. To simplify the term, RSS allows fast browsing for news and updates.

    The syntax rules of RSS 2.0 are quite simple, though strict. Here is a simple RSS document:

    <?xml version="1.0" encoding="utf-8" ?>
    <rss version="2.0">
      <channel>
        <title>Your Website Name</title>
        <link>http://www.yourdomain.com</link>
        <description>Free RSS Tutorial</description>
        <item>
          <title>First Article</title>
          <link>http://www.yourdomain.com/article.aspx?ID=1</link>
          <description>The description of the first article.</description>
        </item>
        <item>
          <title>Second Article</title>
          <link>http://www.yourdomain.com/article.aspx?ID=2</link>
          <description>The description of the second article.</description>
        </item>
      </channel>
    </rss>
    

    The first line in the document – the XML declaration – defines the XML version and the character encoding used in the document. In this case, the document conforms to the 1.0 specification of XML, and uses the utf-8 character set. The next line is the RSS declaration, which identifies that this is, in fact, an RSS document (more specifically, RSS version 2.0).

    The next line contains the <channel> element. This element is used to describe the RSS feed. The <channel> element has three required child elements:

    • <title> – Defines the title of the channel (e.g. Your Website name)
    • <link> – Defines the hyperlink to the channel (e.g. http://www.yourdomain.com)
    • <description> – Describes the channel (e.g. Free RSS Tutorial)

    Each <channel> element can have one or more <item> elements. Each <item> element defines an article or "story" within the RSS feed.

    The <item> element requires three child elements:

    • <title> – Defines the title of the item (e.g. First Article)
    • <link> – Defines the hyperlink to the item (e.g. http://www.yourdomain.com/article.aspx?ID=1)
    • <description> – Describes the item (e.g. The description of the first article)

    When viewed in Firefox, the RSS document above should look similar to:

    RSS document

    Step 1: Getting Started

    To follow this tutorial, imagine that you work as a web developer, and are building a news website where all of the news stories are stored in Microsoft’s SQL Server database. Specifically, the articles are stored in a table called News, which contains the following fields:

    • ArticleID – an auto-increment primary key integer field uniquely identifying each article
    • Title – a nvarchar(256), specifying the title of the article
    • Author – a nvarchar(50), specifying the author of the article
    • Description – a nvarchar(500), providing a more in-depth description of the article
    • DatePublished – a datetime, indicating the date the article was published

    Note that there might be other fields in the News table, but those listed above are the only ones we are interested in using — at least for the purposes of an RSS feed.

    We’ll use Visual Studio to finish the example. If you don’t have the full version of VS, you can grab the free Express Edition.


    Step 2: Creating an rss.aspx Page

    Our next step is to create an ASP.NET Web page (rss.aspx) that will display a list of the most recent news items as a properly formatted RSS 2.0 document. In Solution Explorer, right-click the project name, and then click Add New Item. In thia dialog box, under Visual Studio installed templates, click Web Form.

    Add New Page

     In the Name box, type a name for the new Web page (rss.aspx), and then click Add. The new ASP.NET web page (rss.aspx) is created and displayed, accordingly.

    Because we want the rss.aspx page to produce XML output, the first thing that we must do is remove all HTML markup or web controls from the page, and then set the ContentType property of @page directive to "text/xml".

    After clearing all HTML markup from rss.aspx page, add a Repeater control into the page. We'll use Repeater control to render RSS document on rss.aspx page.

    Here is the source view of the rss.aspx page, after we’ve made some changes:

    <%@ Page Language="C#" ContentType="text/xml" AutoEventWireup="true" CodeBehind="rss.aspx.cs" Inherits="NettutsTutorial2.rss" %>
    
    <asp:Repeater ID="RepeaterRSS" runat="server">
    </asp:Repeater>
    

    Step 3: Setup The Connection String

    Next, we want to setup the connection string of the data source, within the Web.config file. By saving the connection string information, we'll avoid having to hard-code it in the code-behind file. This simplifies things, if the connection string information changes in the future. Place it in the <connectionStrings> section under configuration element, like so:

    <connectionStrings>
      <add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Nettuts.mdf;Integrated Security=True;User Instance=True"
       providerName="System.Data.SqlClient" />
     </connectionStrings>
    

    We will access this information from the code-behind file later when we want to retrieve data from database.


    Step 4: Removing Illegal Characters from the XML Document

    Some characters have special meaning in XML. If you place a character, such as "<", inside an XML element, it will generate an error, because the parser interprets it as the start of a new element. To avoid this error, replace the "<" character with its entity reference (&lt;).

    There are five predefined entity references in XML:

    &lt; < less than &gt; > greater than &amp; & ampersand  &apos; ' apostrophe &quot; " quotation mark

    To avoid our RSS feed producing an error, we have to change all illegal characters in an RSS document with their entity references. Add the following code into the code-behind file of the rss.aspx page (rss.aspx.cs):

    protected string RemoveIllegalCharacters(object input)
    {
        // cast the input to a string
        string data = input.ToString();      
    
        // replace illegal characters in XML documents with their entity references
        data = data.Replace("&", "&amp;");
        data = data.Replace("\"", "&quot;");
        data = data.Replace("'", "&apos;");
        data = data.Replace("<", "&lt;");
        data = data.Replace(">", "&gt;");
    
        return data;
    }
    

    The RemoveIllegalCharacters() function performs a few simple string replacements, if needed. We will call this function from the rss.aspx page shortly.


    Step 5: Retrieving Data from the Database

    Add the following code into the Page_Load event handler:

    protected void Page_Load(object sender, EventArgs e)
    {
        // Get connection string from the web.config file
        string connString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
    
        // Create SqlConnection object
        SqlConnection sqlConn = new SqlConnection();
        sqlConn.ConnectionString = connString;
    
        // SQL query to retrieve data from database
        string sqlQuery = "SELECT TOP 10 ArticleID, Title, Author, Description, DatePublished FROM News ORDER BY DatePublished DESC";
    
        // Create SqlCommand object
        SqlCommand cmd = new SqlCommand();
        cmd.Connection = sqlConn;
        cmd.CommandType = CommandType.Text;
        cmd.CommandText = sqlQuery;
    
        // open connection and then binding data into RepeaterRSS control
        sqlConn.Open();
        RepeaterRSS.DataSource = cmd.ExecuteReader();
        RepeaterRSS.DataBind();
        sqlConn.Close();
    }
    

    The code above will attempt to retrieve the ten most recent news items from your database. It will then bind them to a Repeater control (RepeaterRSS) when the page is loaded.


    Step 6: Rendering Data

    This is our last step. It's time to render items from the News table into an appropriate RSS 2.0 syndication file. The simplest and quickest way to display the database data as XML is to use a Repeater control (RepeaterRSS). Specifically, the Repeater will display the <rss>, <channel>, and Web site related element tags in its HeaderTemplate and FooterTemplate templates, and the <item> elements in the ItemTemplate template. Don't forget to call the helper RemoveIllegalCharacters() function to replace unwanted characters from the string output.

    The following is the HTML portion of our ASP.NET Web page (rss.aspx):

    <%@ Page Language="C#" ContentType="text/xml" AutoEventWireup="true" CodeBehind="rss.aspx.cs" Inherits="NettutsTutorial2.rss" %>
    
    <asp:Repeater ID="RepeaterRSS" runat="server">
            <HeaderTemplate>
               <rss version="2.0">
                    <channel>
                        <title>Name of the Website</title>
                        <link>http://www.yourdomain.com</link>
                        <description>
                        Short description of the website.
                        </description>
            </HeaderTemplate>
            <ItemTemplate>
                <item>
                    <title><%# RemoveIllegalCharacters(DataBinder.Eval(Container.DataItem, "Title")) %></title>
                    <link>http://www.yourdomain.com/news.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "ArticleID") %></link>
                    <author><%# RemoveIllegalCharacters(DataBinder.Eval(Container.DataItem, "Author"))%></author>
                    <pubDate><%# String.Format("{0:R}", DataBinder.Eval(Container.DataItem, "DatePublished"))%></pubDate>
                    <description><%# RemoveIllegalCharacters(DataBinder.Eval(Container.DataItem, "Description"))%></description>
            </item>
            </ItemTemplate>
            <FooterTemplate>
                    </channel>
                </rss>
            </FooterTemplate>
    </asp:Repeater>
    

    The first thing worth noting here is that the rss.aspx file above contains only the Repeater control (RepeaterRSS), and no other HTML markup or Web controls. This is because we want the page to emit nothing but XML output. We set the ContentType of the @page directive to "text/xml" to indicate that the output of the rss.aspx page is an XML document.

    In the HeaderTemplate template of the Repeater control, we place the <rss> and <channel> elements.

    Next, in the ItemTemplate, we place the <item> elements, which contain the <title>, <link>, <author>, <pubDate>, and <description> elements, as the place for database fields. We call the RemoveIllegalCharacters() function when adding the Title, Author, and Description database fields to the XML output. Remember, this function simply replaces any illegal XML characters with their  entity references.

    Finally, the DatePublished database field, entered into the <pubDate> element, is formatted using the String.Format method. The standard format specifier, R, formats the DatePublished value appropriately according to RFC 822, Date and Time Specification. This starts with an optional three-letter day abbreviation and comma, followed by a required day, the three-letter abbreviated month, and then the year, followed by a time with the time-zone name, such as Thu, 04 Nov 2010 20:50:26 GMT.


    The Result

    And there we have it! With minimal effort, we’ve created a custom RSS feed for an ASP.NET application.

    The Resulting Feed

    The Complete Code

    The rss.aspx File

    <%@ Page Language="C#" ContentType="text/xml" AutoEventWireup="true" CodeBehind="rss.aspx.cs" Inherits="NettutsTutorial2.rss" %>
    
    <asp:Repeater ID="RepeaterRSS" runat="server">
            <HeaderTemplate>
               <rss version="2.0">
                    <channel>
                        <title>Name of the Website</title>
                        <link>http://www.yourdomain.com</link>
                        <description>
                        Short description of the website.
                        </description>
            </HeaderTemplate>
            <ItemTemplate>
                <item>
                    <title><%# RemoveIllegalCharacters(DataBinder.Eval(Container.DataItem, "Title")) %></title>
                    <link>http://www.yourdomain.com/news.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "ArticleID") %></link>
                    <author><%# RemoveIllegalCharacters(DataBinder.Eval(Container.DataItem, "Author"))%></author>
                    <pubDate><%# String.Format("{0:R}", DataBinder.Eval(Container.DataItem, "DatePublished"))%></pubDate>
                    <description><%# RemoveIllegalCharacters(DataBinder.Eval(Container.DataItem, "Description"))%></description>
            </item>
            </ItemTemplate>
            <FooterTemplate>
                    </channel>
                </rss>
            </FooterTemplate>
    </asp:Repeater>
    

    The rss.aspx.cs File

    using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using System.Data.SqlClient;
    
    namespace NettutsTutorial2
    {
        public partial class rss : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                // Get connection string from web.config file
                string connString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
    
                // Create SqlConnection object
                SqlConnection sqlConn = new SqlConnection();
                sqlConn.ConnectionString = connString;
    
                // SQL query to retrieve data from database
                string sqlQuery = "SELECT TOP 10 ArticleID, Title, Author, Description, DatePublished FROM News ORDER BY DatePublished DESC";
    
                // Create SqlCommand object
                SqlCommand cmd = new SqlCommand();
                cmd.Connection = sqlConn;
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = sqlQuery;
    
                // open connection and then binding data into RepeaterRSS control
                sqlConn.Open();
                RepeaterRSS.DataSource = cmd.ExecuteReader();
                RepeaterRSS.DataBind();
                sqlConn.Close();
            }
    
            protected string RemoveIllegalCharacters(object input)
            {
                // cast the input to a string
                string data = input.ToString();
    
                // replace illegal characters in XML documents with their entity references
                data = data.Replace("&", "&amp;");
                data = data.Replace("\"", "&quot;");
                data = data.Replace("'", "&apos;");
                data = data.Replace("<", "&lt;");
                data = data.Replace(">", "&gt;");
    
                return data;
            }
        }
    }
    

    The Web.config File

    <?xml version="1.0"?>
    <configuration>
    	<configSections>
    		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    				<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    					<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
    					<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    					<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    					<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    				</sectionGroup>
    			</sectionGroup>
    		</sectionGroup>
    	</configSections>
    	<appSettings/>
    	<connectionStrings>
    		<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Nettuts.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
    	</connectionStrings>
    	<system.web>
    		<!--
                Set compilation debug="true" to insert debugging
                symbols into the compiled page. Because this
                affects performance, set this value to true only
                during development.
            -->
    		<compilation debug="true">
    			<assemblies>
    				<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    				<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    			</assemblies>
    		</compilation>
    		<!--
                The <authentication> section enables configuration
                of the security authentication mode used by
                ASP.NET to identify an incoming user.
            -->
    		<authentication mode="Windows"/>
    		<!--
                The <customErrors> section enables configuration
                of what to do if/when an unhandled error occurs
                during the execution of a request. Specifically,
                it enables developers to configure html error pages
                to be displayed in place of a error stack trace.
    
            <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
            -->
    		<pages>
    			<controls>
    				<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    				<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			</controls>
    		</pages>
    		<httpHandlers>
    			<remove verb="*" path="*.asmx"/>
    			<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
    		</httpHandlers>
    		<httpModules>
    			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    		</httpModules>
    	</system.web>
    	<system.codedom>
    		<compilers>
    			<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    				<providerOption name="CompilerVersion" value="v3.5"/>
    				<providerOption name="WarnAsError" value="false"/>
    			</compiler>
    		</compilers>
    	</system.codedom>
    	<!--
            The system.webServer section is required for running ASP.NET AJAX under Internet
            Information Services 7.0.  It is not necessary for previous version of IIS.
        -->
    	<system.webServer>
    		<validation validateIntegratedModeConfiguration="false"/>
    		<modules>
    			<remove name="ScriptModule"/>
    			<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    		</modules>
    		<handlers>
    			<remove name="WebServiceHandlerFactory-Integrated"/>
    			<remove name="ScriptHandlerFactory"/>
    			<remove name="ScriptHandlerFactoryAppServices"/>
    			<remove name="ScriptResource"/>
    			<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    		</handlers>
    	</system.webServer>
    	<runtime>
    		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    			<dependentAssembly>
    				<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
    				<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
    			</dependentAssembly>
    			<dependentAssembly>
    				<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
    				<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
    			</dependentAssembly>
    		</assemblyBinding>
    	</runtime>
    </configuration>
    

    Conclusion

    Creating an RSS feed with ASP.NET is quite simple, isn't it? We only need to understand the RSS 2.0 specification. Beyond that, by using the .NET Repeater control, we can render items from a database into the RSS document. Most content management systems will have this capability by default. However, if you're a developer, and are building an ASP.NET website from scratch, you now have the skills to build your own custom feed.

    Happy Coding!

    November 02 2010

    04:41

    ASP.NET From Scratch: Controllers and Simple Model Validation


    This latest episode continues to delve into the ASP.NET MVC framework by looking at controllers and their role in MVC applications. You also learn how to perform model validation by implementing the IDataErrorInfo interface.


    The Complete Series


    Controllers and Simple Model Validation

    Press the HD button for a clearer video.
    Premium Members: Download this Video ( Must be logged in)

    Sell ASP.NET Components on CodeCanyon

    Did you know that you can sell your ASP.NET scripts and components on CodeCanyon? Simply sign-up for a free author account, and start selling!

    September 29 2010

    15:55

    ASP.NET from Scratch: Routing in MVC


    In today’s episode of ASP.NET from Scratch, we’ll look into URL routing in the MVC framework, and examine how a request can be routed to a controller and action method. You’ll learn how to use constraints to gain better control over your routers, and also discuss best practices in adding routes to the route table.


    The Complete Series

    Premium Members: Download this Video ( Must be logged in)

    Sell ASP.NET Components on CodeCanyon

    Did you know that you can sell your ASP.NET scripts and components on CodeCanyon? Simply sign-up for a free author account, and start selling!

    September 13 2010

    20:46

    Quick Tip: Using Anonymous Objects for Key/Value Pairs in .NET


    Writing applications using the .NET Framework can be a cumbersome experience, primarily due to the vast amount of classes one has to know in order to write applications. But developers can use those classes to make writing code easier. One such class is the TypeDescriptor class, and the ability to use anonymous objects as a key/value pair collection.

    Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
    Could not load more posts
    Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
    Just a second, loading more posts...
    You've reached the end.
    (PRO)
    No Soup for you

    Don't be the product, buy the product!

    close
    YES, I want to SOUP ●UP for ...