Installation of IIS 8 in Windows 8 Developer Preview


Working with IIS 8 in Windows 8 Developer Preview is quite important as it ‘s a pre-requites to work with Windows Azure tools in Windows 8 Developer Preview. Simply switch to Metro preview & select Control Panel & set to More Settings for Desktop -> Select Turn  Windows features On or Off & set Internet Information Services.

  • Set it default & Click OK. Check localhost in IE 10 for IIS 8.

Advertisements

Building ASP.NET MVC 4 application with JQuery Mobile, HTML5 , CSS3 Media Queries in Visual Studio 2011 Developers Preview


Developing MVC 4 applications with Visual Studio 2011 Developers Preview is quite jump-start for developers as it has inbuilt support for JQuery Mobile css & javascripts, nice intellisense for HTML 5 , CSS 3 media queries. MVC 4 developers preview was built keeping in mind the Mobile Web Developers who wants keen support of rich MVC in Mobile Web.

  • Lets jump start to develop MVC 4 mobile application with JQuery Mobile, HTML5, CSS3 in VS 2011 developers preview.

  • Select your MVC 4 application domain either Internet/Intranet/Mobile Web application  with default Razor or ASPX syntaxes. For my demo , selected Mobile Web application in VS 2011 Developer Preview.

  • Next, write some JQuery Mobile application code to check th UI view in SmartPhones while Model & Controller logic remains same & could change according to business requirements.
  • Database -> Entity Framework (EF) -> Model in MVC 4(Entities) (DAL)-> Controllers (Business Logic Layer)(BLL) -> View(s) -> Master(_Layout.cshtml) is the default development path in MVC 4 Web & mobile application.
  • Sample code for JQuery Mobile with HTML5 for MVC 4 in VS 2011:

@{

ViewBag.Title = “Navigation”;

Layout = “~/Views/Shared/_Layout.cshtml”;

}

<h2>Navigation</h2>

<section id=”page1″data-role=”page”>

<header data-role=”header”>

<h1>JQuery Mobile with ASP.NET MVC 4</h1>

<nav data-role=”navbar”>

<ul>

<li><a href=”#”class=”ui-btn-active”>First</a></li>

<li><a href=”#”>Second</a></li>

<li><a href=”#”>Third</a></li>

<li><a href=”#”>Fourth</a></li>

<li><a href=”#”>Fifth</a></li>

</ul>

</nav>

</header>

<div class=”content”data-role=”content”>

<h3>Sample MVC 4 HTML 5 JQuery Mobile</h3>

</div>

<footer data-role=”footer”>

<h3>Footer</h3>

</footer>

</section>

  • Next , Check the nice intellisense support for HTML5 , JQuery Mobile in Visual Studio 2011 Developer Preview.

  • Check out the MVC 4 Mobile Web applications with JQuery Mobile , HTML5 , CSS 3 media queries in Smart Devices.
  •  iPhone & iPad:

 

  • iPhone:

  • JQuery Mobile View in iPhone of MVC 4 Mobile application:

  • View in Windows Phone 7.1 Mango:

  • BlackBerry 9800:

Asynchronous Programming in .NET 4.5 , HTML 5 , CSS 3 with Visual Studio 2011 Developer Preview


Asynchronous programming has been started with continuation of Dynamic Programming in .NET 4.0 framework with C# , since in .NET Framework 4.5 Client Profile contains a strong support for Asynchronus programming & portrays a full – fleged .NET programming’s future in Asynchronous programming with MultiBinding Support in ASP.Net 4.5 , Strong API with XHTML 5 , CSS 3 , JQuery.

Advantage of Asynchronous Programming: Parallel Programming or Dynamic Programming shows some facilities of Async client call rather than synchronous processing of method. Those of constrains have been throughly modified in .NET Framework 4.5 & enriches the new feature of Asynchronous programming in C# /VB.

Sample Application:

The Sample Application demonstrates the Asynchronous downloading of web: msdn.microsoft.com with left & corresponding page details in right pane of the WPF Windows.

Sample Application Development :

Create a new WPF 4.5 application in Visual Studio 2011 & named in AsyncApp.

Provide the necessary code of MainWindow.xaml:

<Window x:Class=”AsyncLab.MainWindow”

xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation&#8221;

xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml&#8221;

Title=”MainWindow”

Width=”640″ Height=”480″>

<Window.Resources>

<DataTemplate x:Key=”DataTemplateItem”>

<StackPanel Orientation=”Horizontal”>

<TextBlock>

<TextBlock.Text>

<MultiBinding StringFormat=”  {0}  –  {1}  “>

<Binding Path=”Length”/>

<Binding Path=”Title”/>

</MultiBinding>

</TextBlock.Text>

</TextBlock>

</StackPanel>

</DataTemplate>

</Window.Resources>

<Grid>

<TextBox Height=”379″ HorizontalAlignment=”Left” Margin=”12,12,0,0″ Name=”textBox1″ VerticalAlignment=”Top” Width=”294″ />

<ListBox Height=”379″ HorizontalAlignment=”Right” Margin=”0,12,12,0″ Name=”listBox1″ VerticalAlignment=”Top” Width=”294″ ItemTemplate=”{DynamicResource DataTemplateItem}”/>

<Button Content=”Start” Height=”23″ HorizontalAlignment=”Left” Margin=”272,406,0,0″ Name=”Start” VerticalAlignment=”Top” Width=”75″ Click=”Start_Click” />

</Grid>

</Window>

MainWindow.Xaml.Cs:

using System;

using

System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Data;

using System.Windows.Documents;

using  System.Windows.Input;

using System.Windows.Media;

using System.Windows.Media.Imaging;

using System.Windows.Navigation;

using System.Windows.Shapes;

using System.Net.Http;

using System.Text.RegularExpressions;

using System.Collections.ObjectModel;

using System.Threading;

namespace AsyncLab

{

///<summary>

/// Interaction logic for MainWindow.xaml

///</summary>

publicpartialclassMainWindow : Window

{

privateCancellationTokenSource cancellationToken;

public MainWindow()

{

InitializeComponent();

}

private sync void Start_Click(object sender,RoutedEventArgs e)

{

ObservableCollection<string> uris = newObservableCollection<string>();

this.Start.IsEnabled = false;

try

{

var response = awaitnewHttpClient().GetAsync(http://msdn.microsoft.com);

string result = response.EnsureSuccessStatusCode().Content.ReadAsString();

this.textBox1.Text = result;

awaitTask.Run(() =>

{

MatchCollection mc = Regex.Matches(result, “href\\s*=\\s*(?:\”(?<1>http://%5B^\”]*)\”)”, RegexOptions.IgnoreCase);

foreach (Match m in mc)

{

uris.Add(m.Groups[1].Value);

}

});

this.listBox1.ItemsSource = awaitTask.WhenAll(from uri in uris select DownloadItemAsync(newUri(uri)));

}

catch (Exception ex)

{

MessageBox.Show(ex.ToString());

}

this.Start.IsEnabled = true;

}

private static asyncTask<LinkInfo> DownloadItemAsync(Uri itemUri)

{

string item;

try

{

HttpClient httpClient = newHttpClient();

httpClient.MaxResponseContentBufferSize = 1000000;

var response = await httpClient.GetAsync(itemUri);

item = response.EnsureSuccessStatusCode().Content.ReadAsString();

}

catch

{

item = string.Empty;

}

LinkInfo linkInfo = newLinkInfo { Length = item.Length, Title = GetTitle(item), Html = item };

return linkInfo;

}

private static string GetTitle(string html)

{

if (html.Length == 0)

{

return“Not Found”;

}

Match m = Regex.Match(html, @”(?<=<title.*>)([\s\S]*)(?=</title>)”, RegexOptions.IgnoreCase);

return m.Value;

}

}

}

  • HTML5 & CSS 3 has Rich Support in VS 2011 developer Preview in .NET Framework 4.5 Client Profile .

  • The future of Web is Web11 with VS 2011 , HTML 5 & CSS 3.

  • Javascript has more indent set of API in .NET Framework 4.5 Client Profile in VS 2011 developer Preview.

If you check WPF 4.5 development environment compared to WPF 4.0 environment , there has been addition of app.config file in VS 2011 developer preview WPF 4.5 development continues richer set of config support with SKU building. (Traditional Winforms Support)

Next article will describe more about HTML 5 & CSS 3…

%d bloggers like this: