I just did something that I’ve been putting off for a long time: I switched to FireFox. I’d been a longtime Opera fan and I kept hoping that the sites I use would start to support it better, but that didn’t happen and Internet Explorer 7 came out with tabbed browsing, so I couldn’t justify sticking with it. I knew there was also FireFox, but I didn’t want to put the time into learning a new interface.
Back in February, Scott Guthrie posted an article on URL rewriting with ASP.Net. Towards the end of the article there is a section on how to handle form post backs by sub classing HtmlForm (for ASP.Net 1.0 and 1.1) or by using a Control Adapter (for ASP.Net 2.0).
That seemed like a lot of work to get a viable solution so I decided to try and find a simpler solution before I “bit the bullet”. Additionally, ASP.Net 2.0 Themes do not always work with URL Rewriting and the article did not provide a solution.
The solution is to use the Application PostMapRequestHandler event to rewrite back to the original URL after the request has been mapped to its handler.
The Problem
I had a MultiLine TextBox inside an UpdatePanel and I wanted that TextBox to have rich editing capabilities so I chose FCKEditor. But, now when I do a partial PostBack, the TextBox doesnt retain it value.
An Initial Solution
So, I searched for a solution to this problem and found this post, but it seemed like more of a hack than I prefer.
If for some reason you cannot create an wildcard mapping to ASP.net in IIS, but would still like to have directory URLs in Umbraco there is another way. You can use ISAPI_rewrite (or a similiar tool) to rewrite requests to an extension that is handled by ASP.net. Here are the ISAPI_rewrite rules I use to accomplish this for JLCoady.net:
NMock2 will have a verification failure if all expected calls are not made and if any unexpected calls are made. That last bit can make writing test code rather tedious.
I have a presenter and I’m testing its normal path using a bunch of calls like the following:
Expect.Once.On(view).GetProperty("Name").Will(Return.Value("Widget"));
Expect.Once.On(view).GetProperty("Quantity").Will(Return.Value(3));
Expect.Once.On(view).GetProperty("Price").Will(Return.Value(9.95m));
Expect.Once.On(view).Method("ShowTotal").With(29.85m);
That’s all good, but now I want to test some error conditions, exceptions, bad input, etc., but I dont want to repeat all the property test, especially considering the maintenance issues—if I add a new call to another property in my presenter, all my tests will fail because there was an unexpected call. It would be much nicer to only have to change one test instead of many. Not to mention that testing the same thing ten times is rather stinky.
I am about to embark on a project that will be using ASP.NET AJAX extensively, along with the ASP.NET AJAX Control Toolkit. I would love to be able to do the whole thing inside of Umbraco, but, as far as I know, the only way to use these controls is from within a macro.
For example (very simplified), I have a list of items that I want to display. Each item gets a delete button. I would like to put each item into an updatepanel and so when the delete button is clicked, the item simply disappears. There is no need to reload the entire page when we are just changing one small portion of it.
Right now, my options would be to put the entire list inside a macro or write all the ajax myself (which seems like a step backward).
I am creating an Umbraco site with a document type that has rich text (my innovation here is astounding!) and everything was working great on my local. Then I upload it to the production server and the rich text editor now has a navy blue background with black text and is centered—editing is now very difficult. Since the site I am creating has a navy blue background I had an obvious culprit and a quick test by deleting the site’s style sheet confirmed my suspicions.
After tinkering for a while and do some searching, I have found out why this was happening only on the production site and how to fix it.
