December 2008 Entries
If you are interested in learning on the upcoming .NET Framework 4.0 and Visual Studio 2010, here is an excellent resource for you.
Channel 9 is going to host a weekly podcast on the different capabilities of .NET Framework 4.0 and Visual Studio 2010 at http://channel9.msdn.com/shows/10-4/
While I am currently playing with the VS 2010 and .NET Framework 4.0 build, I am more than keen to tune into these podcasts to hear what others have to say about the new features.
If you aren’t aware, we released the initial bits of VS 2010 and .NET Framework at our Professional Developers Conference http://www.microsoftpdc.com last month and the bits are available now as a VPC Download at http://www.microsoft.com/downloads/details.aspx?FamilyId=922B4655-93D0-4476-BDA4-94CF5F8D4814&displaylang=en
Yes it is a pretty huge download and interestingly, the podcast series is hosting the first podcast on how to get this set up optimally and start using it.
So, tune in to http://channel9.msdn.com/shows/10-4/ and get to know the features of the upcoming VS 2010 and .NET Framework 4.0
I have been playing around with WPF Applications and one of the annoying things about WPF as well as Windows Forms is that they always open up in a Normal View (which is like a Restored View) and you have to maximize it to have a full view of your application. I know this is a simple setting right from the VB Days and was wondering where to set it up in case of WPF.
The solution was to just to add the following line of code under the “InitializeComponent()” call in your Window1.xaml.cs or whatever is the startup Window.
this.WindowState = WindowState.Maximized;
I am sure there are different ways to achieve this and it can be set at the configuration level etc., But this post is just for simply doing it quickly.
If there are caveats, best practices, please post in the comments..
I just had the privilege (trauma?) of setting up my new machine and had to install everything from the scratch. I will save the rest of my experiences, for another post, but for now I thought of sharing, what I had to install to work with the latest stuff for Web Development in ASP.NET. These are pretty quick to install and helps you build cutting edge websites.
1. Install Visual Studio 2008 (you can get a trial version from http://msdn.microsoft.com/hi-in/vstudio/products/aa700831.aspx)
or the free Visual Web Developer Expression Edition from http://www.microsoft.com/express/vwd
2. Install .NET 3.5 SP1 and Visual Studio 2008 SP1 from http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en
3. If you installed Visual Studio 2008 and would like to work with ASP.NET 2.0 Applications and use ASP.NET AJAX 1.0 version (multi-targeting in Visual Studio 2008), install the ASP.NET 2.0 AJAX Templates for Visual Studio 2008 http://www.microsoft.com/downloads/details.aspx?FamilyID=5c7df430-1c34-40d2-b6ec-81353b5fcf2e&displaylang=en
4. Install ASP.NET MVC Beta from http://www.microsoft.com/downloads/details.aspx?FamilyId=A24D1E00-CD35-4F66-BAA0-2362BDDE0766&displaylang=en
5. Install Charting controls for Visual Studio from here and here
6. Install the Windows Live Tools for Visual Studio 2008 http://dev.live.com/tools
7. Install the Silverlight essentials from http://silverlight.net/GetStarted
8. Install the Ajax Control Toolkit from http://www.codeplex.com/AjaxControlToolkit/Release/ProjectReleases.aspx?ReleaseId=16488
9. Last but not the least, visit http://www.asp.net/learn for learning resources
Note that steps 3-7 are optional though recommended. The Silverlight installation contains steps to install Silverlight runtime, Silverlight Tools for Visual Studio (the MediaPlayer control for playing videos)
Hope this saves you from running to different locations.
Here is a HelloWorld sample on the new ASP.NET Charting control.
To begin with, install the free Microsoft Chart Controls and the "Tools for VS 2008 for Chart Controls" from here and here
Note that if you don’t install the Tools for VS 2008 for Chart controls, the Chart Server Control doesnt show up in the Toolbox
Once you are done with the installation, restart Visual Studio if you are already running the same (of course, save your work)
1. Start Visual Studio 2008 and create a File – New – ASP.NET Website or a Web Application
2. From the ToolBox, under Data tab, pick up the “Chart” control (the icon would be a series of colored bar graphs) and drag and drop it into the page.
3. Click on the smart tag for configuring the Chart control and Choose DataSource
4. Select “Database” and provide the connection string to your database server (in my case I chose Northwind)
5. Choose to save the connection string etc., and select the Database table (in my case I chose “Category Sales for 1997”)
6. Click “Finish” to complete the process.
7. Now if you run the page you will NOT get the Chart Control.
8. You need to select the Properties of the Chart Control from design view.
9. Make sure under “Data” DataSource is set to “SqlDataSource1” unless you gave a different name and DataMember is set to “DefaultView”
10. Under “Series” in Properties, click on the tab to open up the “Series Collection Editor”.
11. Scroll down the Series1 Properties to DataSource section.
12. Specify “CategoryName” as the XValueMember and “CategorySales” for YValueMembers and click Ok.
13. Build the page and hit F5 to run the page.
14. You will be able to see the Chart in your webpage.
15. Right Click on the chart and you would be able to see that it is an image generated dynamically that can be saved as a “.png” file.
You can download a comprehensive list of samples from here and verify the different implementations and source code for the same. For more details, visit the forums here
The Windows Live Team put up a neat bunch of controls that can be used in your ASP.NET Websites. In fact once you install the Windows Live Tools for Visual Studio 2008 from http://dev.live.com/tools/ you get a few server controls in the toolbox as well as website templates for Visual Studio 2008 project/website.
I wanted to demonstrate how you can quickly add a video to your website that is being streamed from the Silverlight Streaming Service, all within 5 minutes.
1. Visual Studio 2008 or Visual Web Developer Expression Edition
2. Windows Live Tools for Visual Studio 2008 (http://dev.live.com/tools/)
3. Your video uploaded to Silverlight Streaming Service
i. Visit http://silverlight.live.com
ii. Sign-in using your Live ID/Hotmail/Passport
iii. Click on "Get it Free" Icon
iv. Click on "I accept Terms and Conditions"
v. You would receive an Account ID and Account Key (GUID ID)
vi. Note them for your reference for now. You would also be able to view it every time you login.
vii. Click on "Manage Videos" in the left
viii. Click "Upload Video" to provide a video title as well as uploading the video.
Adding your uploaded video into ASP.NET Website
1. Create a File - New - ASP.NET Windows Live Website
2. From the ToolBox under "Windows Live" Tab, drag and drop "SilverlightStreamingMediaPlayer" into the page
3. Click on the smart tag ">" on the Top right of the SilverlightLightStreamingMediaPlayer control in design view.
4. Click on the tab next to the URL textbox in the "SillverlightStreamingMediaPlayer Tasks" wizard.
5. It prompts you with a dialog for providing the Account ID and the Account Key.
6. You would need to provide the same that you acquired from the steps in pre-requisites above.
7. Click on "List" and it will provide a list of the videos uploaded by you to the Streaming Service already.
8. Select the video and click "Ok" to add it to the page.
9. You are all set to play your streaming video in your ASP.NET Website.