Monday, November 06, 2006

My collegue and I arrived in Barcelona after a flight of about 2 hours. The registration went smoothly and I'm really looking forward to the sessions that'll start tomorrow. The hotel itself, in the center of the city Barcolona, is new since the beginning of this year and is quite comfortable. The internet connection however in the hotel is a bit slow but it can keep up with my typing ;-). The weather is also a lot better than in Belgium so the next thing we'll be doing is to take a peek in what Barcolena has to offer.

Grz, Kris.

 

Monday, November 06, 2006 4:42:09 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Sunday, October 29, 2006

The freely available tool WebMatrix, which I used on my old pc to develop ASP.NET pages several years ago, came with a built in webserver, code named Cassini, so a developer could test his/her pages on the localhost.

With the .NET 2.0 framework this localhost only webserver's shipped and if you don't have Visual Studio 2005, or the free Visual Web Developer Express Edition tool (which is the follow up of WebMatrix), you can still execute your pages and view the outcome in a browser.

Here's a little guide on how to proceed:

Create a folder on your hard drive. In this example I created c:\MyASPNETPages\ where my testpage will reside. The testpage itself contains this code:

    1 <%@ Page Language="C#" %>

    2 

    3 <script runat="server">

    4 

    5     protected void Page_Load(object sender, EventArgs e)

    6     {

    7         Label1.Text = DateTime.Now.ToShortDateString();

    8     }

    9 

   10 </script>

   11 

   12 <html>

   13 <head runat="server">

   14     <title>Test Page</title>

   15 </head>

   16 <body>

   17     <form id="form1" runat="server">

   18     <div>

   19         <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

   20     </div>

   21     </form>

   22 </body>

   23 </html>

Now start up a DOS box (Start | Run, type in cmd followed by enter). Navigate to the folder C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

If you don't know how to do this you can type in the following in the opened DOS box:
cd \windows\microsoft.net\framework\v2.0.50727

After that you can type in the text in bold:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>webdev.webserver /port:8088 /path:
"c:\MyASPNETPages" /vpath:"/Test"

Ok what does this mean?

webdev.webserver is the executable itself with the following arguments: port, path and vpath. Port and vpath are optional parameters. After typing the previous lines in bold in and pressing enter a webserver starts up (Figure 1):


Figure 1: Started up webserver

From Figure 1 we can also see what our url will look like (http://localhost:8088/Test).
This demonstrates the purpose of the port and vpath arguments. Port is the port number on which the server will listen. The default is 80 but if you have IIS running, like me, it's better to use another number or they will conflict.

 

After starting the webserver I can easily navigate to my webpage by typing in the url in the address bar of my browser: http://localhost:8088/Test/

As you would've expected I get to see the current date displayed in my page.

If I ommit the vpath argument it would default to "/", meaning that I can navigate to my pages by just typing in this in the address bar: http://localhost:8088/test.aspx

Grz, Kris.

Sunday, October 29, 2006 1:05:19 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, October 24, 2006

You can listen to the podcast from Hanselminutes.com. Podcast 37 is an interview with Scott Guthrie.

Also Dino Esposito was busy writing about/teaching ASP.NET AJAX. This resulted in an upcoming book called Introducing ASP.NET 2.0 AJAX Extensions. Best of all, you can download a free chapter of it here.

The TOC of the upcoming book:

  • Building Blocks of Ajax-style Web Applications
  • Building Blocks of the Atlas Application Framework
  • Updatable Page Fragments
  • Atlas Control Toolbox & Behaviors
  • The Atlas Client Library
  • Web Services
  • Client-side Data Binding
  • Atlas Gadgets
  • I can only hope that the final book will cover the updated Microsoft AJAX bits since last week the Beta 1 was released and I already saw on the ASP.NET forums, where I'm a moderator and top 10 poster, that a lot of threads are added with questions/problems about the new bits as there seems to be a lot of changes since the CTP releases.

    Grz, Kris.

    Tuesday, October 24, 2006 12:56:18 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [3]  |  Trackback

    While I was reading through all the subscribed blog feeds that I keep track of (indeed too much to read, too little time available) I found out that Charles provides a link to a chapter about 3D in XAML that didn't make it in the final book. You can download it here as a word document: Chapter 32. Entering the Third Dimension.

    Grz, Kris.

    Tuesday, October 24, 2006 8:01:36 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  |  Trackback
     Monday, October 23, 2006

    When I was still a kid I enjoyed creating stuff from paper or carton. A bit of glue and scissors and lots of fun. Also origami was something I enjoyed and it wouldn't be the first time I folded a Crane.

    I stumbled upon this site today but I did find a great resource of paper models and origami that you can print out and fold. Boy, why didn't this stuff exist 20 years ago?

    Well, here's the link to the good stuff: http://cp.c-ij.com/english/3D-papercraft/.

    If someone knows where I can find a tutorial on creating a paper/carton clock please tell me.

    Update: Malcolm Metzler emailed me with this link: http://www.yamaha-motor.co.jp/global/entertainment/papercraft/index.html. Looks great.

    Grz, Kris.

    Monday, October 23, 2006 2:46:20 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  |  Trackback

    Setting the Width property of a control in ASP.NET is mostly done in the properties pane or by declaratively setting it in the markup. However sometimes you want to set it in code. This can be done by using the Unit structure.

    I crafted some small example that you can run to play around with the different UnitType enumerations. Possible choises are:

    Cm Measurement is in centimeters. 
    Em Measurement is relative to the height of the parent element's font. 
    Ex Measurement is relative to the height of the lowercase letter x of the parent element's font. 
    Inch Measurement is in inches. 
    Mm Measurement is in millimeters. 
    Percentage Measurement is a percentage relative to the parent element. 
    Pica Measurement is in picas. A pica represents 12 points. 
    Pixel Measurement is in pixels. 
    Point Measurement is in points. A point represents 1/72 of an inch. 

    The sample provided here loops over the possible unit types and fills up the dropdownlist. The second textbox is used to fill in an amount to set the Width of the first textbox control to. If you don't fill in an amount it automatically defaults to 30.

        1 <%@ Page Language="C#" %>

        2 

        3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        4 

        5 <script runat="server">

        6 

        7     protected void Page_Load(object sender, EventArgs e)

        8     {

        9         if (!Page.IsPostBack)

       10         {

       11             // Set the original width to 300 pixels

       12             TextBox1.Width = new Unit(300);

       13 

       14             // Loop over the possible unit types

       15             foreach (string s in Enum.GetNames(typeof(UnitType)))

       16                 DropDownListSelectUnitType.Items.Add(Enum.Format(typeof(UnitType), Enum.Parse(typeof(UnitType), s), "G"));

       17         }

       18     }

       19 

       20     protected void Button1_Click(object sender, EventArgs e)

       21     {

       22         // Obtain the chosen width, if it's not filled it default to 30

       23         int width = !String.IsNullOrEmpty(TextBoxSetWidth.Text) ? Convert.ToInt32(TextBoxSetWidth.Text) : 30;

       24 

       25         // Obtain the chosen unit type

       26         UnitType type = (UnitType)Enum.Parse(typeof(UnitType), DropDownListSelectUnitType.SelectedItem.Text, true);

       27 

       28         // Use the Unit structure to set the width of the textbox

       29         TextBox1.Width = new Unit(width, type);

       30     }

       31 </script>

       32 

       33 <html xmlns="http://www.w3.org/1999/xhtml" >

       34 <head runat="server">

       35     <title>Untitled Page</title>

       36 </head>

       37 <body>

       38     <form id="form1" runat="server">

       39     <div>

       40         <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />

       41         <br />

       42         <br />

       43         Width: <asp:TextBox ID="TextBoxSetWidth" runat="server" Width="40px"></asp:TextBox><br />

       44         Type: <asp:DropDownList ID="DropDownListSelectUnitType" runat="server">

       45         </asp:DropDownList><br />

       46         <asp:Button ID="Button1" runat="server" Text="Set Textboxes width" OnClick="Button1_Click" />

       47     </div>

       48     </form>

       49 </body>

       50 </html>

    Grz, Kris.

    Monday, October 23, 2006 10:05:53 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  |  Trackback

    I installed IE7 last week and really enjoy it. This morning I took a look at the on10 site of Microsoft and saw the video about addons for IE. I like the inline search capability of FireFox and when I saw there's an addon for IE available I immediately installed it. It's a bit of a shame that it isn't the default search functionality in IE but the addon does the work :-).

    Taken from the website: Inline Search is an extremely useful free add-on for Internet Explorer that mimics Firefox's search behavior, it turns searching into a Web page into a non modal research experience coupled with a search as you type facility. It integrates flawlessly into IE (version 5.5 or above), giving it that little extra that makes you a lot more efficient when you are looking for a specific piece of information.

    You can download the addon here.

    Grz, Kris.

     | 
    Monday, October 23, 2006 8:40:02 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  |  Trackback
     Sunday, October 22, 2006

    I develop on several different pc's like the one that's provided by the customer, my laptop, ... I'm one of those people that likes their custom added keyboard shortcuts, custom color markup in the code. Loosing these settings, or having to set them all again when changing to another computer, would be cumbersome and a waste of time. Luckely for us Visual Studio 2005 provides the ability to export these settings and import them on another computer.

    Exporting:

    Go to Tools | Import and Export Settings... and the following screen will appear (Figure 1):


    Figure 1: Import and Export Settings Wizard

    Choose Next and the following screen will be displayed:


    Figure 2: Select the settings to export

    Check all the settings you want to export and choose Next. In the next step you can provide the location and name for the exported settings:


    Figure 3: Specify a name for the exported settings and a location

    Choose Finish the wizard will export all your settings. Now you just copy the generated file to your other pc and follow the Importing steps.

    Importing:

    Go to Tools | Import and Export Settings... The screen of Figure 1 will display. Choose Import selected environment settings and click Next. You get another possibility to first backup the current settings of the new computer. If it's your computer you can decide to not backup the current settings but if it's a pc that's also used by others its a wise precaution to backup first!


    Figure 4: Possibility to backup the current settings before importing new settings. 

    Then you select the settings you want. In this example I chose the exported settings:


    Figure 5: Select the settings to import


    Figure 6: Select settings to import

    After that you choose Finish and let Visual Studio 2005 import the settings.

    Grz, Kris.

    kick it on DotNetKicks.com

    Sunday, October 22, 2006 2:05:16 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  |  Trackback

    I was unaware of this at first, which gave me some frowns on my face when I found out the hard way, but results in SQL Server Management studio are truncated to a certain amount of characters. Normally you won't notice this but when a certain line exceeds that amount you'll notice the truncated text. I experienced it while concatenating several columns casted as varchars.

    By default the maximum amount of characters is 256 but you can easily edit this setting by going to Tools | Options. There you set a higher number of maximum displayed characters in the right lower corner of the screen when you navigate to Query results |SQL Server | Results to Text (or to Grid):

     

    Grz, Kris.Recenet

    kick it on DotNetKicks.com

    Sunday, October 22, 2006 1:22:30 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  |  Trackback
     Thursday, October 19, 2006

    I've been using IE7 since the betas and really liked the new version. Especially the tabbed pages and the overview that you can take of all open windows on 1 page is a great experience. I don't really use the built in RSS capabilities at the moment as I use GreatNews to read my subscribed feeds. The integrated search and the possibility to select a different search engine is something I was fond of when using FireFox. Now it's also integrated in IE.

    You can download IE7 or take a tour of the features here: http://www.microsoft.com/windows/ie/default.mspx.

    Grz, Kris.

     | 
    Thursday, October 19, 2006 7:34:56 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  |  Trackback
     Wednesday, October 11, 2006

    Just noticed on the blog of Microsoft watch that there's a a comparison made, by Microsoft, for their own Visual Studio to Dreamweaver (former Macromedia, currently Adobe).

    The comparison page can be found here.

    Grz, Kris.

    Wednesday, October 11, 2006 7:01:31 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  |  Trackback
     Monday, October 02, 2006

    Just saw on the Belgian MSDN site that Kurt Claeys, a member of VISUG like me, wrote an article about State machine workflows in Windows Workflow Foundation. Last week we both attended the .NET 3.0 Framework Development event.

    Nice to see that he describes the state machine side of WF. Ingo Rammer did a great explanation about creating workflows on the event but didn't show state machines during his speech.

    Grz, Kris.

    kick it on DotNetKicks.com

     | 
    Monday, October 02, 2006 7:44:12 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [1]  |  Trackback

    Currently I drive an Audi A4 and am very satisfied of that car. Luckely because I drive about 1000 - 1200 km / week for my work.

    Well, I just found out about this new Audi R8 thanks to Coolz0r's blog. Man does this car look hot or what? I would certainly like to testdrive this one myself.

    Grz, Kris.

    Monday, October 02, 2006 6:37:38 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [3]  |  Trackback