Welcome to DevAuthority.Com Sign in | Join | Help

In a previous blog post I reviewed ASP.NET AJAX in Action and walked away with what I felt was a good grasp of ASP.NET AJAX and felt I could get started implementing AJAX in our main enterprise level application.  Recently, I borrowed Professional ASP.NET 2.0 AJAX (Published by WROX) from a friend to see how it compared.

Overall I feel the AJAX in Action book was a far better book.  The amount of detail that was covered in that book was surprising.  After reading the the WROX book, I felt the book did not really go into enough details about how things work and how to do real world tasks with ASP.NET AJAX. 

The wrox book covered some of the basic concepts related to the update panel and the script manager.  There was also a real good introduction to JavaScript for the developers that may not have much experience to the language.  Finally the WROX book had a chapter on creating a control.  The chapter first created a client side version of the control, and then converted it to a server control.

While the WROX book covered the update panel, script manager, and control creation, I feel AJAX in Action went into a lot more detail about these concepts.  The AJAX in action book spent 2 chapters covering the update panel.  When it came to control creation, the level of detail that was covered between the two books do not compare.  The chapter in the WROX book was almost like an entire code listing of how to do it, with very little explanation.

To wrap it up, I feel I made the right choice in buying ASP.NET AJAX in Action as it was a far better book.  If you are looking at these two books, I would definetly pass on the WROX book as all of the information in that book is covered in the AJAX in Action book.

ASP.NET AJAX In Action

I just completed reading the book ASP.NET Ajax In Action and thought I would share my opinion of the book.  While I have read various blogs and articles on AJAX, I am just now starting to implement it into our main enterprise level application, and wanted a book to really get me started in the right direction.

Overall I feel the content of the book is very good and the topics are delivered in an easy to read format.  I really like the layout of the book, and feel the chapters were organized very nicely.  I did not feel like the authors jumped around from topic to topic too much, and the flow of the book felt very natural.

For developers that are new to AJAX and JavaScript, then they will appreciate the first couple of chapters where those topics are addressed.  There are two chapters devoted to JavaScript that will be useful to beginners as well as experienced JavaScript developers. These chapters will be useful for seasoned JavaScript developers because you will get a feel for some of the conventions that are used within the library, as well as how the client library is structured.

The book then moves to the introduction of the server extensions that are provided by Microsoft.  We are introduced to the ScriptManager and what its role is in regards to the page life cycle on the client and the server.  We are also introduced to the UpdatePanel and partial page updates and how they help eliminate the visual aspect of the postback.

The book really starts to get good when it dives into the UpdatePanel and how the framework provides tools to help integrate the client and server.  The authors go into some of the advanced topics related to the UpdatePanel, and also discuss some of the limitations related to the control.  Then they start talking about creating client components, extenders, and controls.  They provide a good level of detail on how to create each of these different types of components on the client side.  They then teach you how to take what you just did on the client and make it interact with the server architecture that we are already familiar with.

Finally, the book wraps up with a look at what is coming in the next version of ASP.NET AJAX.  They go over XML Script and the drag and drop engine that is currently in development.  They also discuss various patterns related to AJAX that help you build better AJAX applications.

Overall, I really liked this book.  While I have read various articles and blogs about AJAX, this is my first book on the topic and I feel that I have a really good grasp to apply AJAX to our enterprise level application.  

Chapter by Chapter Look

Chapter 1 – Introducing ASP.NET AJAX
This chapter offers a good introduction to AJAX and how AJAX was added to ASP.NET.  The chapter provides the goals of ASP.NET AJAX and also introduces you to the two approaches to how to implement AJAX within your application: the server centric solution and client centric solution.

Chapter 2 – First steps with the Microsoft Ajax Library
This chapter focuses on the JavaScript library that is provided by Microsoft.  There is a good high level overview of the various features provided by the library, as well as an introduction to the new client side lifecycle that they expose.  The authors also review the abstraction API that was created to hide the incompatibilities with all of the browsers when dealing with the DOM and JavaScript.  They discuss positioning, events, and CSS, all of which have browser incompatibility issues.  Finally, the authors wrap up with a review of new JavaScript objects and concepts that exist in the library that make JavaScript more familiar to .Net developers.  They review objects and concept such as string builders, arrays, formatting, and globalization.

Chapter 3 – JavaScript for Ajax developers
If you are new to JavaScript, then this chapter will be real helpful.  The authors dive into JavaScript and cover some of the most important concepts such as scope, closures, and prototypes.  This is a real good introduction to get you up to speed with JavaScript.  They also go into details about how the Microsoft library tries to introduce true OO into JavaScript by explaining how the library allows a developer to create classes, interfaces, enumerations, and base classes.

Chapter 4 – Exploring the Ajax server extensions
The authors now start to focus on the server side aspect of ASP.NET AJAX.  They start with explaining the role of the ScriptManager and how it manages JavaScript files and provides the ability to register services that you can access through script.  This chapter also discusses the basics related to partial page updates, the update panel, and the timer object.  The chapter wraps up with how to handle exceptions from the server and how they integrate in with the custom error section of the web.config file.

Chapter 5 – Making asynchronous network calls
This chapter focuses on creating web services that can be called from the client to exchange data between the client and the server.  The authors outline the steps involved in creating and register web services so they can be used by AJAX enabled web sites and also explains how you can invoke the web service using the Microsoft AJAX Library.  The concept of creating a complex type on the client and the server is also discussed.  Next, the authors discuss a new concept that is available in the ASP.NET futures CTP, called Bridges, which is an alternative for communicating with remote services.  The authors wrap up the chapter with a discussion of ASP.NET application services, which are remote services that expose the authentication and profile services that exist in ASP.NET.

Chapter 6 – Partial-page rendering with UpdatePanels
To start the chapter, the authors start with a simple ASP.NET site that has traditional postbacks, and then demonstrate how UpdatePanels can eliminate those postbacks with no code changes.  The authors explain the various update modes related to the UpdatePanel and how to trigger an update to the panels.  The ASP.NET page lifecycle is reviewed and the authors explain how the UpdatePanel is affected by the various stages of the life cycle.  They wrap up the chapter by providing a more advanced example of using an UpdatePanel to apply AJAX functionality to the GridView control.  They use the UpdatePanel to take over the filter and sorting functionality as the user types in a filter string.

Chapter 7 – Under the hood of the UpdatePanel
The authors wrap up their coverage with the update panel by diving into the inner working of how it works.  They cover how to interact with update panels on the client side and how the PageRequestManager works and the different events that the object expose to your application.

Chapter 8 – ASP.NET AJAX client components
This chapter really focuses on how a developer can take what they know about creating controls and objects on the server, and recreating those objects and controls on the client.  We are introduced to how to create non-visual and visual components, including behaviors and controls on the client side and the object model that exists to assist us in creating those objects.  This expands on the inner workings of the Microsoft Library a bit, and what has been provided to us to make it easier to recreate our server components on the client.  

Chapter 9 – Building Ajax-enabled controls
The authors now move back to the server and expand on what was covered in chapter 8 by talking about how to take what you created in chapter 8 and make it accessible from the server.  They introduce us to the ExtenderControl and ScriptControl base classes as well as the IExtenderControl and IScriptControl interfaces.  The classes and interfaces lay the groundwork so we can build extenders and AJAX controls.  The authors explain how these interfaces and base classes help you automatically wire up the server side controls to the client side controls.

Chapter 10 – Developing with the AJAX Control Toolkit
Considering one of the authors are involved in the development of the toolkit, it would make sense that there would be a chapter about it.  This chapter does not explain each and every control, but rather focuses on the API the toolkit provides to make it easier to create extenders and controls.  The toolkit introduces a few new base classes and provides some attribute classes to help make the development of extenders and controls easier.   The chapter wraps up by talking about the framework that exists to assist with animations and visual effects.

Chapter 11 – XML Script
This chapter is the first of two chapters that talk about ASP.NET AJAX Futures, and talks specifically about XML Script.   It provides examples of how to use XML Script to create and wire up client components.  The authors also explore a feature of XML Script called bindings.  This allows automatic synchronization between properties of two objects.

Chapter 12 – Dragging and dropping
One of the most exciting pieces of eye candy when it comes to AJAX applications, has to do with drag and drop functionality.  The authors spend a chapter explaining the drag and drop engine that is coming in the next release.  They talk about how you would need to implement a few interfaces in order to support this feature.  They wrap up the sample by creating a shopping cart application.

Chapter 13 – Implementing common Ajax patterns
The final chapter of the book discuss a few patterns related to versioning, debugging, and how to make your JavaScript files smaller in size.  The authors even provide some functions that you can use for shortcuts when you are wiring up events and creating properties.  Finally, the chapter wraps up by talking about the navigation issues related to AJAX, and some solutions to breaking the back button in the browser.

I recently started learning about Silverlight and throught I would share the resources I have found that have helped me get started.  Although I decided to jump right into Silverlight 1.1, I still use any Silverlight resource I can find since its still applicable.

Here is my list so far.  If you know of other good resources, please share in the comments:


Silverlight Blogs

0 Comments
Filed Under:

I found out today that Silverlight actually supports two installation methods.  The standard installation method will actually redirect the user to the Microsoft website to download and install Silverlight.  They will see a logo such as:

Default Silverlight Installation Logo

The other installation method is an inline installer method that will keep the user on your site. Your users will see a logo such as:

Inline Silverlight Installation Logo

According the MSDN docs, to have the inline installer it's as simple as setting the inplaceInstallPrompt property to true. You can find this property defined in your CreateSilverlight.js file that is usually created for you wheny ou create a Silverlight project in Visual Studio or Expression Design.

0 Comments
Filed Under:

On the last day of MIX I attended a session about performance and AJAX.  Toward the end of the session Emre Kıcıman talked about a project he is working on in the research labs over at MS, called AJAX View.  Here is what the project site has to say:

The Ajax View approach is to insert a server-side proxy (or web server plugin) in-between the web server machines and the end-user's browser. This proxy captures the web application's JavaScript code as it is being sent to a browser and rewrites the code to insert extra instrumentation code. The injected instrumentation code runs with the rest of the web application inside the end-user's browser and can capture performance, call graph, application state and user interaction information, providing visibility directly into the last hop of the user's experience.

The demo of the tool looked awesome, and at the end of his presentation he asked for feedback.  Look for it to be released soon....

If you are a gamer and have not tried GameFly yet I would suggest giving it a try.  They recently introduced some additional plans, and also have promo pricing for the first month.  The first plan starts at $8.95.

Right now they have a promo where if you get 5 friends to join, you get a free WII.  Even if you were to pay for your friends subscription, you could get a WII for $45, as opposed to the $250 they sell for in the store.

Feel like helping a fellow blogger out?  Sign up here and stay a member for one month:
http://friends.GameFly.com/r/24b0c966390b102a919d

 

With my Xbox 360, I have had hit or miss connection issues wiht people on xbox live.  Recently it has been with Tiger Woods 07 and Call of Duty 3.  The main reason why I bought COD 3 is for the online play, and it was frustrating when I couldn't get online.  The game would show me available games and I would choose one that had a strong connection.  While trying to connect it would come back with a message similiar to "Game session no longer available, or something close to that.

I then came across this KB article:

http://support.microsoft.com/kb/908874/en-us?sd=xbox

This article talks about the ports that need to be open in order to have the best experience on Xbox Live.  Now, I have the DLink DI-524 router that is supposed to be XBox Live compatible, but it appears that it did not open the ports that are listed in the KB article.  Ports 88, 2074, and 3074 all need to be setup to be forwarded to your xbox. 

As a reminder to myself, and possibly others who come across this, here are the steps I took to get my Xbox working:

Navigate to the admin tool of your router.  This is usually done by type 192.168.0.1 in the address bar of your browser.  Once you are there you should see a screen like this:

home page

Ensure you are on the home tab and click on the DHCP button on the left so we can assign the xbox a static IP. The DHCP screen should look like this:

DHCP screen

On the DHCP screen, there should be a list of DHCP clients that have previously connected to your router.  To find your Xbox MAC address you will need to go to your Xbox 360 dashboard and head to the system blade.  Then go to network settings, edit settings, additional settings tab, then the second group that shows advanced settings.  Once you get in there it will show your MAC address.  Now I have a wired Xbox, so it shows the MAC address for the wired connection.  I am sure if you are connected wirelessly, it will show the MAC address for your wireless connection. 

Once you have your MAC address, go back to your router admin and find it in the list of DHCP clients and click clone.  Then, in the IP field, give it an IP address.  This will be the IP address that the Xbox always gets assigned when it connects.  Click apply when done, and you should see it listed in the Static DHCP Client list.

Once you have a static IP setup, next, click the Advanced tab and ensure the Virtual Server button is highlighted.  The Virtual Server page should look something like this:

Virtual Server page

Here is where we will setup the port forwarding for ports 88, 2074, 3074, just follow these steps:

  1. Ensure that the enabled radio button is selected. 
  2. Name the virtual server.  
  3. Put in the IP you just assigned to your Xbox in the previous step. 
  4. Set the protocol type to both. 
  5. For both private and public port type in 88
  6. Set the schedule to Always
  7. Click Apply
  8. Reat steps 1 - 6 and enter port number 2074 and 3074 for step 5.

Once these steps have been completed, click the Tools tab along the top, then click the misc button on the left, then click the reboot button.  Once the router comes back up, restart your Xbox 360.  My first attempt at playing after these changes still gave me the same error, but when I tried again it worked. Hopefully by following these steps, you have the same success as I do.

For people with other routers, the two main steps are to setup a static IP address for your xbox and setup port forwarding.  Here is a good web site to help setup the port forwarding, http://www.portforward.com/routers.htm

Good Luck

 

1 Comments
Filed Under:

This looks like another interesting Google project

http://www.google.com/codesearch

An except from an MSNBC article:

"The Web search leader said late on Wednesday it is introducing Google Code Search, a site that simplifies how software developers search for programming code to improve existing software or create new programs."

Today I took the 70-528 Microsoft.net Framework 2.0 - Web based client development exam and passed.  One more test to go and I got the MCPD for web development. 

The exam was your typical MS exam with a lot of vague quesitons, but here is the breakdown from what I remember:

  • 45 total questions
  • 5 or so questions on mobile controls and development
  • 5-10 questions on the new membership provider, roles, and impersonation
  • 5 or so questions on master pages
  • 5 or so questions on writing server controls
  • 5 or so questions on working with web parts
  • 5 or so questions with deploying a web site, either using the publish web wizard or the copy website tool
  • 5 questiosn on working with xml
  • 5 or so questions on datasources, binding, ado.net.

I think they vary the questions from exam to exam so you may see different results, but this should still help some people out.

Good luck!

Today, I took advantage of the free offer from Microsoft to take a beta exam for free.  In case you missed the memo, I put the details about the free beta exams at the end of this post.  The beta exam I took was 70-547: Designing and Developing Web-Based Applications using the .Net Framework.  Since it was a beta exam it was a pretty lengthy exam of 71 questions that took three hours long.  Here are some notes about the exam:

  • Since it was a design exam, there were a lot of questions about if a solution solved all of the requirements given.  So they stated the requirements and then told you what the solution was and you have to decide if the solution met the requirements, or select a reason as to why it did not.  This got real redundant, but I think that was because I was taking a beta exam.  I think they were really trying to figure out what questions would be good ones to ask for the real exam.
  • There were about 5-10 questions or so on the new ASP.NET health check API.
  • There were about 5-10 questions in regards to writing test cases using VS 2005.
  • There were a few questions that asked you to design out a class when given a certain set of requirements.  This was not your normal multiple choice question either.  They did help you along a bit and gave you a list of methods and properties that you have to move into your class.
  • There were also questions in regards to how to handle exceptions correctly and ensure that you maintain a proper stack trace across tiers such as presentation, business, and data.  Also, how to configure apps so that end users don't see the error, while admins can.
  • There was not a lot of code in this test, whcih was NOT a surprise since it was a design test.
  • Just a few questions on what controls to use when in your design.  There was a question about the datagridview control and master pages.  These questions were more interested in how to work these new features into your design.

Beta Exam Info:

Through March 12 Registration is open for free beta exams, which count toward certification in the same way as the final version of the exam. Candidates who achieve a passing score in the beta exam will receive a free exam voucher* for any Microsoft Certification Exam. Vouchers will be sent after exam scores are tabulated.

  • Exam 71-547 Pro - Designing and Developing Web-based Applications by Using the Microsoft .NET Framework (promo code: PRO547)
  • Exam 71-548 Pro - Designing and Developing Windows-based Applications by Using the Microsoft .NET Framework (promo code: BTA548) 
  • Exam 71-549 Pro - Designing and Developing Enterprise Applications by Using the Microsoft .NET Framework (promo code: 549BTA)

Seating is limited. Pre-register via http://securereg3.prometric.com/.

0 Comments
Filed Under:

I finally got a project where I can start playing with some winform stuff.  I have been doing .net for a few years now, but only in the c#/asp.net world.  I now have the chance to write an application in a winform environment, which I have been looking forward to.

One of the things I wanted to play with was customizing the listview.  I wanted to set the listview up so that the column widths automatically adjust their width based on the data that is being displayed within them.  Back in my VB6 days, we ended up subclassing a lot of the common controls and I have used Randy Birch's vbnet web site quite a bit, so I figured I would start there for the info. Since all of the code is in VB, I use this little vb to c# converter to convert some of the constants and such.

The next part was getting the send message called defined, so here is what I came up with:

    public class UnsafeNativeMethods

    {

 

        public const int LVM_FIRST = 4096;

        public const int LVM_SETCOLUMNWIDTH = (LVM_FIRST + 30);

        public const int LVSCW_AUTOSIZE = -1;

        public const int LVSCW_AUTOSIZE_USEHEADER = -2;

 

        public UnsafeNativeMethods()

        {

        }

 

        public IntPtr SendMessage(IntPtr hWnd, int msg, int wparam, int lparam)

        {

            return UnsafeNativeMethods.SendMessage(new HandleRef(this,hWnd), msg, wparam, lparam);

        }

 

 

        [DllImport("user32.dll", CharSet=CharSet.Auto)]

        internal static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, int lParam);

 

    }

Once I got that defined, I was able to create a method that would setup this extended style for my ListViewEx control:

            UnsafeNativeMethods methods = new UnsafeNativeMethods();

 

            for( int x=0;x<Columns.Count;x++ )

            {

                methods.SendMessage( this.Handle, UnsafeNativeMethods.LVM_SETCOLUMNWIDTH, x, UnsafeNativeMethods.LVSCW_AUTOSIZE_USEHEADER );

            }

One final thing I had to do for the listview was to ensure that when the listview was resized that the far right column fills out the unused area of the listview.  To ensure this, I had to override the WndPrc method and capture the onpaint method and reset that style:

        protected override void WndProc( ref Message message )

        {

            const int WM_PAINT = 0xf ;

 

            // if the control is in details view mode and columns

            // have been added, then intercept the WM_PAINT message

            // and reset the last column width to fill the list view

            switch ( message.Msg )

            {

                case WM_PAINT:

                    if ( this.View == View.Details && this.Columns.Count > 0 )

                        this.Columns[this.Columns.Count - 1].Width = -2 ;

                    break ;

            }

 

            // pass messages on to the base control for processing

            base.WndProc( ref message ) ;

        }

0 Comments
Filed Under:

I just started my first project that involves creating a winform app.  While researching some various UI controls that I can  use within my app I came across the Krypton Toolkit that has been  recently released with a free commerical license.  I was looking for something that was designed for the 2.0 framework, which this library is.

Some of the controls:

Krypton Button
Krypton Group
Krypton Header
Krypton HeaderGroup
Krypton SplitContainer
Krypton Panel
Krypton Label

 

Download here, http://www.componentfactory.com/downloads.php

0 Comments
Filed Under:

Yesterday I saw that one of my co-workers was connecting to SQL Server through Visual Studio and figured I would give it a try.  Normally I use query analyzer but I liked the idea of working with Sql Server within Visual Studio, but forgot you can do that.  As I was writing some stored procs and playing around with some data, I noticed an option on the context menu, "Step Into Stored Procedure" which allows you to debug and walk through stored procudures.  So I gave it a whirl, and man will this be a huge time saver.  You have all your normal debug windows available such as watches and auto so you can look at variables, which is a lot better than the print statements I used to use.

What is the difference between a blog post and an article?

Also, if you guys have some code that you want to provide for download with a post/article, how do you guys usually do that?

Over the next few weeks I'll be posting a series of articles about what I am learing from looking through the Community Server source code and how I am working some concepts into my applications. 

One tool that I find extremely helpful in doing so is the COJAX tool that they put together.  This is a code viewer tool that uses AJAX to display the code for the application.

Check it out at http://code.communityserver.org

 

More Posts Next page »