Fremus.co.za

Demistifying Life and Web Development

Archive for the 'ASP.NET' Category

ASP.NET, handlers and IHTTPHandler

I have never used handlers (.ashx) files in any of my .NET web development projects, but this all changed in the last two days. The way I understand a handler is that it acts as a ‘process’ handler and does not write any output to the browser. Where would you use this? Well I used it for a shopping cart (but in hindsight I will change this) by using a handler to process the items added to the cart. The handler took a querystring and created a datatable of none existed or added the data to a datatable if that datatable already existed and stored the datatable in a session variable, which could then be accessed throughout the application. Accessing querystring variables in a handler file requires that you implement the IHTTPHandler interface, i.e. you cannot simply type Request.Querystring in the handler.

  • Share/Bookmark
Tags: ,
posted by fr3dr1k in ASP.NET,C# and have No Comments

Panel and its DefaultButton property

ASP.NET has a server control called a panel, which allows you to display other server controls or HTML elements inside it, and one of its properties is DefaultButton. By setting the DefaultButton to the ID of a button within the panel you basically set its default keyboard event that will fire the click event associated with that button. The other alternative to this would be to add the property to the TextBox in your CodeBehind.

  • Share/Bookmark
Tags:
posted by fr3dr1k in ASP.NET,C# and have No Comments

Silverlight Content Test in WordPress and on Apache

What does it take to host Silverlight content on a site? Why would I want to publish Silverlight content on my website?

Well, to host Silverlight content on a website that runs Apache is not the same as running .NET content on IIS. Its kinda obvious that .NET content cannot and will not run under Apache. Remember though that Silverlight is a plugin, the same as Flash, and you are simply pointing to a file (XAP) that executes on the client side. Silverlight is a client side technology if you really think about it. I have in the week for instance, experienced that content will not immediately update on the client side even if you updated it on the server side.

It is thus possible to run Silverlight content on Apache, as this simple HTML document shows. It however seems that running Silverlight in WordPress requires an iframe:

Why would I want to run Silverlight on Apache? There are many reasons I can think of and the list may grow or shrink depending on what I think is relevant for me, but here are some reasons:

  • I can keep my C# skills and keep using Visual Studio. Why would I want to give up using one of the best and most powerful IDE’s in the world.
  • Silverlight is a genuine Flash alternative and because it integrates so beautifully with Visual Studio and C# I can truly start developing great rich internet applications
  • Share/Bookmark
posted by fr3dr1k in ASP.NET,C#,Silverlight and have No Comments

Waiting…to build some Silverlight applications

As I sit waiting for the Visual Studio Service Pack 1 ISO to finish downloading, I spent some time looking and reading about Silverlight and about C#. I have found one or two good websites, ones that I go to regularly to check for updated articles and source code. So three of my favourite Silverlight websites at the moment:

  • Martin Grayson’s Adventures of a ‘Devigner’: The title, ‘devigner’, of the blog suggests that Martin Grayson sees himself as a real designer/developer. Maybe he has that one thing that all developers sometimes miss, the knack to design and develop in one breath. I guess neat and tidy and functional is not always good enough. Then again creativity, in my opinion, can be subjective.
  • Smart Draw:I have linked to them before or written about them before and they keep the website updated with new source code all the time. I like the fact that they actually illustrate that it is possible to do something both in Flash and Silverlight.
  • Silverlight Made Simple by – Corey Schuman:
  • Is another favourite website of mine because I got source code for a simple media player from it.

Silverlight 2 was officially released recently, which meant an entire update of tools and plugins, hence the reason for downloading the Visual Studio Service Pack 1. With the new release of Silverlight you need to download a few things:

  • Silverlight Developer Tools
  • The updated Silverlight Plugin
  • Visual Studio Service Pack 1

I downloaded the ISO for the service pack because I wanted to distribute it on more than one user machine.

  • Share/Bookmark
posted by fr3dr1k in Silverlight and have No Comments

So, is everything event driven?

I am busy with a Silverlight video player at the moment, and what is interesting to note and understand is that Silverlight is heavily event-driven, as is ASP.NET and a lot of the .NET framework. You can attach event handlers to almost any object, from mouse event handlers to click event handlers.

Having asked that question I took a look at the ASP.NET page life cycle and just realised how intrinsic events are in the .NET framework. There are eight basic stages in the ASP.NET page lifecycle:

  1. Page Request
  2. Start
  3. Page Initialization
  4. Load
  5. Validation
  6. Postback Event Handling
  7. Rendering
  8. Unload

Within the page lifecycle there are events raised, which allows you to write code that initialises controls that are dynamically created.

  • Share/Bookmark
posted by fr3dr1k in ASP.NET,Silverlight and have Comment (1)

Nobody seems to know about Silverlight, for now

I would be the first to admit that not a lot of people have heard or know about Silverlight, which is Microsoft’s rich internet plugin, which is an alternative to Adobe’s Flash. It is true that Flash has been around for a long time and that Silverlight will not dislodge Flash’s entrenched following and use. But maybe, just maybe Silverlight was not designed for that purpose and that if people respond to Silverlight in certain ways it means they are taking some notice at least. The response clearly does not take into account the opportunities Silverlight offers a .NET developer. As a .NET developer I can use my C# skills to develop rich internet applications. I do not have to learn Action Script. Those same skills that I use to develop Silverlight applications can be used to develop WPF applications, ASP.NET applications and Windows applications.

  • Share/Bookmark
posted by fr3dr1k in ASP.NET,C#,Silverlight and have No Comments

Demystifying some .NET Issues

What seemed a little odd to me today was that SQL Server Express 2005 is download-able from two places. Both shows different file sizes.

Another issues that needs clarity is ASP.NET and .NET framework versions. .NET 3.5 is an ‘extension’ of .NET 2.0 and replaces .NET 3.0. .NET 3.5 covers AJAX (Asynchronous JavaScript and XML) and LINQ (Language Integrated Query)

  • Share/Bookmark
Tags: ,
posted by fr3dr1k in AJAX,ASP.NET,Web Technologies and have No Comments

jQuery and Microsoft

I susbscribe to The Code Project’s newsletter and today I got some great news, jQuery will be supported in Visual Studio 2008. Now this is some awesome news. Makes one wonder if the Microsoft AJAX library will become redundant.

You can read the full article on Scott Gu’s website.

  • Share/Bookmark
posted by fr3dr1k in AJAX,ASP.NET,Web 2.0,Web Development and have No Comments

Silverlight 2 Release Candidate Now Available

So Silverlight has gone from Beta 2 to Release Candidate and this means that developer tools have to be updated again. This is a pain sometimes, but I guess it goes with liking to develop on a particular platform (.NET). You can read Scott Gu’s article here.

  • Share/Bookmark
posted by fr3dr1k in ASP.NET,Silverlight and have No Comments

Windows I’m a PC Campaign

Have you ever seen any of the Steve Ballmer videos on Youtube where he sells Windows? Well here is another one, but interestingly enough if you click through to the Windows I’m a PC Website you browse through a myriad of short video clips of people that say “I’m a PC”. This is Microsoft’s attempt to create a better image for Windows Vista, and I don’t know if it works and if it will work later on. Another interesting thing to note is that even Microsoft use Mac and Adobe products to develop the graphics for this campaign, as can be seen in this post. I admit that I love some of the Microsoft technologies that I work with, especially Silverlight, simply because it opens up opportunties for me as a C# developer.

  • Share/Bookmark
posted by fr3dr1k in C#,General,Silverlight and have No Comments
Get Adobe Flash playerPlugin by wpburn.com wordpress themes