Windows 7 and My 2 year old Laptop#

I have owned a Dell Inspiron 9400 for almost 2 years with Vista Ultimate and have enjoyed it for the most part.  I had some issues with wireless and getting the sluggish feeling after I had visual studio, 20 browser tabs open, iis 7, sql server, etc. all open at the same time.  Of course I thought, well i have a lot of stuff running at same time so of course it will be slower.  Well now with Windows 7 I have not one wireless issue, speed is crazy faster and I  am still only using 1 gb of ram of 2 gb available. 

I am absolutely shocked a how much better I like my laptop.  I have a 8 Gb Vista 64 desktop at home, so my laptop is always going to seem sluggish, but now I really like using my laptop.  I am not looking forward to having to wipe it again when the beta expires, but is well worth the joy i now get from my laptop. 

Windows7DesktopSmall

I love the new task bar and my favorites always being down there.  I can’t remember if I have even done a full reboot in a month.  Oh if you are going to try this at home, make sure to do a clean install. 

Tuesday, February 24, 2009 9:00:35 AM UTC #    Comments [590]  |  Trackback

 

Enabling 301 redirects on IIS 7 on Windows server 2008#

I was stumped the other day as to why i could not get a 301 redirect in from site.com to www.site.com on IIS 7.  After much looking around I found out that you need to enable this feature in the server manager. 

image

Then you need to go back to the IIS node that you want to enable 301 redirect for:

 

image

And then set the values for your redirect:

image

If you notice what is also cool is that it will redirect addresses relative to the domain and not just to the root (i.e site.com/oldfile.htm will redirect to www.site.com/oldfile.htm

Hope this helps someone, cause it was not very intuitive for me to find out how to do it since the feature was not installed by default.

Thursday, February 05, 2009 10:37:27 AM UTC #    Comments [510]  |  Trackback

 

ASP.NET MVC 1.0 Release Candidate Is Released#

Time to dig into the T4 template system (learn here) in Visual Studio since they added a cool feature for generating scaffold controllers and views. Check out ScottGu's Article, of course. I am thinking that this was influenced by the SubSonic MVC Scaffold Addin from Rob Conery a little bit ago. I am so happy that we are going to have our own scaffold playground with built in tools. It is getting so much closer to how I really want to develop web apps. Woohoo!

I know it has been a long time since i blogged, since before the holidays. Four kids is a little bit busier than I imagined, but all worth it. I am still trying to stay up late to learn more new things coming out in the web world, as I love the information overload. Much more to come soon I am sure!

Just found this link. You will need this to check out the MVC futures stuff that has Html.TextBoxFor(p => p.PropteryName).

Wednesday, January 28, 2009 8:31:47 AM UTC #    Comments [139]  |  Trackback

 

How to speed up your ASP.NET Website#

Recently we noticed that our site was a little sluggish.  Now of course when we started to look at why it was slow sometimes and not others, we opened up a huge can of worms.  Was it our code?  Was it our server?  Was it our proxy server?  Was it our database?  Was it our graphics?  Was it the JavaScript?  Or was it just that the end user had a slow connection?  Well it was all of them. 

Sometimes we forget that not everyone has FIOS.  We are very lucky to have a 20 Mbps / 20 Mbps connection at work.  So first thing we did was to look at the size of our pages when downloading the html, CSS, images and JavaScript.  We were shocked at the size of the files.  The first eye opening fact was that our home page was 1.5 MB.  Whoa.  The best tool that we found to figure the details out was YSlow.  Here is a snippet from their site about what the tool does:

YSlow analyzes web pages and tells you why they're slow based on the rules for high performance web sites. YSlow is a Firefox add-on integrated with the popular Firebug web development tool

This tool saved us so much time figuring out what our issues were.  I highly suggest reading the rules.  Also you can listen to a recent podcast from DotNetRocks: YSlow! Steve Souders finds Website Bottlenecks

So we began the process of optimizing the client.  The first thing you can do is to compress the JavaScript, CSS and html files on the server to reduce the file download size up to 75% on the client.  The way to do this in IIS6 is to enable GZip compression.  This is turned off by default which I think should actually be turned on by default.  Here is some info on how to enable it for specific file types.  Don't forget the .axd files if you use and Ajax in webforms.

Using HTTP Compression for Faster Downloads (IIS 6.0)

So next on our list was minimizing the size of the images that we were using as backgrounds in CSS.  They are the first calls from the browser when loaded from CSS.  Also moving JavaScript references to the bottom of the page helps.  The browser using a blocking request when loading JavaScript files, so if you have them at the top of the page, you will get a perceived load issue since the browser waits for that first.  The best thing to get out of optimizing for the client is the perceived load to the user which really makes the most difference.

So after removing the client side issues we realized we had a database load issue on certain pages with many records.  Well we found out we ran into the famous ORM gotcha of way too many queries when using strictly the data objects with related foreign key objects.  For instance, by relating a member record to the aspnet user table and doing a foreach on the member and then checking to see their username on the aspnet user table, it will cause another db query to get that info for each user.  Sometimes when using the orm objects that are generated instead of writing a custom query to populate your own domain object, you can get into a lot of trouble.

Our website has many applications to it, some mvc and some using webforms.  We have noticed a significant speed increase on the mvc sites.  There is less code to render and there is no Viewstate so right away there is some performance increases. 

I hope that this helps some other people figure out why their site is slow for some people some of the time.

Wednesday, December 10, 2008 9:52:17 AM UTC #    Comments [166]  |  Trackback

 

Missed PDC 2008? Go to MSDN Developer Conference#

If you missed PDC 2008 in L.A this year, you can catch some sessions at the MSDN Developer Conference in Orlando on December 11, 2008. It's only $99, so I am sure the registrations will fill up fast.  Here is a blurb from their site about what it will cover:

We’re bringing the PDC to you! For just $99 you’ll get the best of the PDC in your own backyard and hear all of the exciting announcements around the Azure Services Platform and Windows 7. Other sessions include the latest developments in .NET, Silverlight, Surface, Parallel Programming, Live Mesh, and more.

Register today to stay current in an ever-competitive job market, enhance your skills and gain access to the next generation of tools and technology.

  1. Experience the Azure Services Platform
    Create applications that seamlessly bridge PC, Web, and phone
  2. Be among the first to see Windows 7
    See the latest advances in Multi-Touch Application Development
  3. Take your .NET skills to the next level
    See sessions on WPF 4.0, Silverlight 2, ASP.NET 4.0, Parallel Programming, Live Mesh and more

The Cost? Just $99.
And, did we mention that attendees will get some cool giveaways?

 

For more information, here is a link to the site and registration page

http://www.msdndevcon.com/Pages/start.aspx

See ya in Orlando!

Monday, November 10, 2008 7:45:16 AM UTC #    Comments [99]  |  Trackback

 

Scaffolding in an ASP.NET MVC App#

So at work I had to create a simple admin for a few new features in our app and decided I would try out a few new technologies while I was at it to not only save some time, but to see what is out there now.  My heart was set on this being a simple MVC web app, but really wanted to try ASP.NET Dynamic Data also.  Well good news is that you can use Dynamic Data in MVC fairly cleanly and easily.  By adding a simple route to the global.asax.cs file you can easily have Dynamic Data working although it is web forms based:

 MetaModel model = new MetaModel();
            model.RegisterContext(typeof(MvcApplication1.Models.NorthwindDataContext), 
                new ContextConfiguration() { ScaffoldAllTables = true });
            routes.Add(new DynamicDataRoute("DD/{table}/{action}.aspx") {
                Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }),
                Model = model
            });

Now this opened my eyes a little that you can easily create a hybrid web app of MVC and Web Forms.  Web Forms does have its advantages sometimes, especially when you start looking at existing tools and controls that you just need to work quickly and don't feel like reinventing the wheel.

You can download a sample project of this working in an mvc app over at codeplex. http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14473

That same night I was playing with Dynamic Data, Rob Conery had just posted his prototype of a Subsonic MVC Add-in for Visual Studio.  I was pretty impressed with the code and views that it generated, and I think is a great start to seeing what is possible.  Both samples took less that an hour to download and implement.  I ended up spending more time integrated security across the multiple web apps on different sub-domains than getting the scaffolds to work.

Wednesday, October 29, 2008 8:10:43 AM UTC #    Comments [166]  |  Trackback

 

jQuery and Microsoft#

I was always hoping this might happen.  Support from Microsoft along with distribution of jQuery with Visual Studio and ASP.NET MVC.  Scott Guthrie and Scott Hanselman along with John Resig have some more detail in their posts.

I plan to update my post, Ajax Control Toolkit and ASP.NET MVC, to use jQuery and the toolkit.  It is about using CSS selectors and the Ajax control Toolkit as an alternative way to use the toolkit in any web development platform.  I modified the Microsoft Ajax library to support CSS selectors, but it is a poor hack and would much prefer to use jQuery anyway.  I was trying to see if I could make it work with the Microsoft Ajax Library from their old preview version from last year.  I was wondering if they would try to reinvent the wheel.  I am glad they decided not to.

Monday, September 29, 2008 4:57:19 AM UTC #    Comments [113]  |  Trackback

 

ASP.NET MVC Firestarter in Tampa#

It was just put out there that David Hayden, Joe Healy and I will be doing a ASP.NET MVC Firestarter here in Tampa, FL on Monday November 17 at the new Microsoft office.  It should be a lot of fun and very informative.  David and I both have live sites in production using various versions of ASP.NET MVC Previews, so we have plenty of real world experience.  So far I have no complaints and it has been very nice that we can modify the source code of the framework if we need to and my team actually has modified one thing that we needed when we went live back in May earlier this year.  Here is some details on what will be covered and how to register:

Throughout the day we will be demonstrating the ASP.NET MVC Framework in a cookbook-style approach with recipes on how to solve common challenges when developing MVC web applications. No previous knowledge or experience is necessary. We will walk you through the basics on creating views and controllers and by the end of the day show you how to develop end-to-end MVC applications complete with Ajax, authentication, authorization, caching, databinding, logging, persistence, validation, and other common challenges we experience in day-to-day development.

Sample code will leverage and integrate popular frameworks and libraries like ADO.NET Data Services, ASP.NET AJAX, ASP.NET Dynamic Data, Enterprise Library, Entity Framework, and LINQ To SQL to show you how to write less code and be more productive during your development.

Polish it all off with examples showing the extensibility of the MVC Framework using custom controller factories, alternative view engines, and custom action filter attributes just to name a few.

Topics covered will include “How Do I...”

- Create Views Easily? ( HTML and Url Helpers )

- Handle Get and Post Requests? ( simple databinding of action method arguments, ActionResults, etc.. )

- Pass Data Between Views and Controllers? ( ViewData and TempData )

- Bind Views and Forms to complex data types? ( ModelBinders )

- Handle Errors Gracefully? ( ActionFilter Attributes )

- Provide Input Error Validation? ( ValidationMessage, ValidationSummary, ViewData.ModelState )

- Handle Authentication and Authorization? ( ActionFilter Attributes and Membership Provider )

- Persist to a database ( LINQ To SQL, Entity Framework )

- Log Messages to Database, File, EventLog ( ActionFilter Attributes, etc. )

- Leverage AJAX and JSON? ( ASP.NET AJAX and jQuery )

- Leverage DynamicData? ( Futures )

Some of the more complex and non-beginner topics can be discussed if time is allowed and/or maybe discussed afterwards in a social environs…

- Alternate View Engines

- IoC and Custom Controller Factories

- Unit Testing

Bring your USB Flash Drive to grab the sample code and begin developing ASP.NETMVC Web Applications today!

 

Microsoft Office – Tampa, FL
5426 Bay Center Drive

Suite 700

Tampa, FL 33609

Monday, November 17, 2008

9:00 AM–4:30 PM

Click here to register or call 877.673.8368 with event ID1032390730.

Friday, September 26, 2008 5:54:28 PM UTC #    Comments [169]  |  Trackback

 

 

All content © 2012, Jim Zimmerman
Book
New Book
Links to me
On this page
Sponsors
Calendar
<February 2009>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
1234567
Archives
Tags
Blogroll OPML
Technorati
Favorite Links
Disclaimer

Powered by: newtelligence dasBlog 1.9.6264.0

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail