I recently implemented MiniProfiler into an existing ASP.NET WebForms application that makes use of databinding to the SqlDataSource control. Since the SqlDataSource uses a DbProviderFactory internally, it is fairly simple to exend the control to utilize MiniProfiler through inheritance and overriding a single method of the SqlDataSource. Here’s a very simple class that inherits from the SqlDataSource control and injects MiniProfiler support to be able to profile the SQL query used by the contr... [More]
Today, I just posted the latest Web.Maps.VE v3.0 release. The coolest thing about this new version is that is has a FREE Edition for non-commercial use!
Download Web.Maps.VE v3.0 FREE Edition!
There are a few new things in this latest release, but the most significant are the following performance updates:
Microsoft CDN (Content Delivery Network) Support Added. This helps improve the Bing Maps content delivery speed by up to 82%
Yesterday, Chris Pendleton officially announced that the Microsoft Virtual Earth ASP.NET Control is now Dead. Frankly, I’ve considered it “dead” for a long time now since it didn’t get updated much, didn’t have a completely full feature support, has a few bugs AND you couldn’t use it within your applications because it was just a Preview (CTP) anyway.
There are however a few good things to point out in the light of Microsoft killing its Virtual Earth ASP.NET ... [More]
Event Driven Basics
First we'll start by creating a Person class that inherits from the Sys.Component class. Now remember, sin... [More]
Update: StackOverflow.com has since added the ability to include StackOverflow "Flair" on your own website; basically a "badge" that contains your StackOverflow.com Name, Avatar, Score and Medal counts within a nice little box. I'm not sure when they added it, but now it's officially supported.
And, for reference, my original StackOverflow Badge code is still below:
I was thinking it would be cool if you could place a StackOverflow "badge" on your ... [More]
Update 9/16/2008: After too long, I finally tried uninstalling SP1 and reinstalling it and that fixed the issue. I'm glad it's fixed now! I haven't seen any other suggestions for fixing this, and I first tried repairing the installation, but only an uninstall and reinstall fixed it. Hope this helps solves anyone elses headache with this issue.
A few months ago (back in February actually) I blogged showing how to use the new DataContractJsonSerializer to serialize your .NET objects to JSON... [More]
Update 2009/03/26: There is an updated version of this code (with improvements) that targets the ASP.NET MVC 1.0 RTW located here: http://pietschsoft.com/post/2009/03/ASPNET-MVC-Implement-Theme-Folders-using-a-Custom-ViewEngine.aspx
Update 8/29/2008: I posted a new blog post today that contains updated code for this example that works with the newly released ASP.NET MVC Preview 5. The new code is located here.
One option to do theming in ASP.NET MVC is to use the standard ASP.NET Theme fun... [More]
I recently started getting to know the ASP.NET MVC Framework (more specifically the Preview 4 release). The first thing I noticed upon installation is that it only comes with a Web Application Project Template. There is no regular ASP.NET Website template. So, I decided to try converting the Web Application Project Template to a regular ASP.NET Website. I actually prefer to use Website projects instead of Web Application projects since it gives a little more flexibility to deploy changes to the ... [More]
There are a few services out there that serve up screenshots of any webpage for you to display on your website. One popular one is Kwiboo; this is the one that DotNetKicks uses. For some time now I've wondered what the easiest way to do this in .NET was, and today I stumbled upon the undocumented WebBrowser.DrawToBitmap method that makes this extremely easy to do.
By the way, I stumbled upon the WebBrowser.DrawToBitmap while taking a look at the source code for the WebPreview tool over at SmallS... [More]
The problem with using WebParts with UrlRewriting (or UrlMapping) is the WebPart PersonalizationProvider uses the path of the page being rendered to save/load the personalization state, not the path that was rewritten that the user sees. So, to fix this you just need to create a custom PersonalizationProvider and override all the methods that reference path, and call the base methods but pass in the path that was requested instead of the path being rendered.
Here's a SqlPersonalizationProvider I... [More]
What is an... [More]
A couple months ago I blogged about the fact that using Virtual Earth and ASP.NET AJAX together on the same page caused errors in Safari. There is good new to report back, the latest update to Virtual Earth has fixed this issue. In fact Virtual Earth v6.1 actually includes much better Safari support that previous versions; it actually works correctly in Safari. I found this to be especially helpful since I can now support Safari with my Web.Maps.VE product.
What's the catch? I can't... [More]
I've been using ASP.NET AJAX alot for a while now, so I thought I'd share some of the Tips and Tricks that I've learned though my adventures. Lately, all the buzz has been around Silverlight, but I know there are still a lot of devs out there that can benefit from these tips and tricks.
By setting the UpdatePanel's UpdateMode property to Conditional, it will only update its contents when one of its triggers o... [More]
Object to Serialize
Here's a simple Person object with First Name and La... [More]
Yesterday, I released the fourth update release (v1.00.04) of my Web.Maps.VE component. The main feature addition in this update is the addition of .NET 3.5 support.
Below is an overview of the main features of Web.Maps.VE. For more information you can go here: http://simplovation.com/Page/WebMapsVE.aspx
In case you're not familiar, Web.Maps.VE is an ASP.NET AJAX Virtual Earth Mapping Server C... [More]
Today, I just saw that Google released their Chart API. Basically, the Google Chart API allows you to dynamically generate charts for use in your web applications. All you do is pass your data in the querystring and an image is returned. This isn't really a service to get too excited about, but it is pretty simple to use. And, it's Free.
I decided to code up a small ASP.NET Server Control that uses the Google Chart API to put simple line graph charts on a page. The image on the right is actuall... [More]
Go check it out: ht... [More]
Here's some simple code for easily adding Subsite functionality to an ASP.NET website using UrlRewriting/UrlMapping.
Urls are rewritten in the following fashion:
~/jdoe/default.aspx => ~/default.aspx?site=jdoe ~/jdoe/subfolder/default.aspx => ~/subfolder/default.aspx?site=jdoe
And this is all done by the 65 line HttpModule below:
using System; using System.Web;
/// <summary> /// Summary description for SubsiteRewriteModule /// </summary> public class ... [More]
Rewriting a path with a slash ("/") in it will cause a HyperLink's image specified in the ImageUrl property within an App_Theme file to not be displayed. This can also lead to a "Cannot use a leading ..." error when running the website within IIS.
Here's a screenshot of the issue occuring:
This is kind of a strange bug, since doing the same thing with an Image works just fine. It's only the HyperLink that breaks. I experienced this issue the other day, and it took me a little bit ... [More]
Scott Guthrie announced on his blog today, that Microsoft will be releasing the source code for .NET 3.5 as shared source under the Microsoft Reference License (MS-RL). You will also be able to enable debugging support within Visual Studio 2008 for the .NET Framework.
This is really cool. I have always used .NET Reflector to peek into the source of the framework, but now I'll actually be able to look at the code itself.
More Info:Releasing the Source Code for the .NET Framework Libraries ... [More]
There are a number of extensions made to the Array base type, including "add", "remove" and ... [More]
I’ve been working with the ASP.NET AJAX Extensions a lot lately, and have been learning a few trick on how to get stuff done. One of the things I’ve learned is how to create a Generic TypeConverter for ASP.NET Ajax to use when serializing my server-side objects to JSON when passing them down to the client-side.
When creating an ASP.NET Extender Control (using ASP.NET AJAX and the AJAX Toolkit) you can add custom properties to your Extender (using the ExtenderCont... [More]
I was looking through the code of the new BlogEngine.NET project last week, and noticed that it implements the ASP.NET Provider Model. Cool an example I can study! I've been trying to spend some time lately to learn more about design patterns, so this was an interesting find for me.
If you look at the code for BlogEngine.NET you'll see that it is a rather simple application that demonstrates a working implementation of the ASP.NET Provider Model that you can learn from.
Go check out the code a... [More]
If you set the visible property of TabPanels within your TabContainer to false, it still shows the Header Text in the page when rendered. What should happen is any TabPanels with Visible set to False should be hidden. A fix for this has been posted to the AJAX Control Toolkits Issue Tracker, but we have to wait for the next release to get the fix in place.
Is there a work around?
Below is an Inherited class I created using the fix described to allow me to fix this issue myself u... [More]