January 2009 - Posts
Today I was adding a webservice via "Add Web Reference" to my project. The webservice was only accessible on https with a client certificate. When I did "Add Web Reference" I got a "The underlying connection was closed: Could not establish secure channel for SSL/TLS", but in IE it's works perfect. After some research I found an other way to add the webservice via "Add Web Reference". You can do it like this:
- Save the WSDL to a location on your machine.
- Copy the path.
- Go to the Add Web Reference in your project.
- Paste the path you copied into the URL.
- Click on Go.
- Click on Add Reference
Don't forget to change the webservice url in your Web.config or App.config.
A common task in a project is preparing your for a deployment. The easiest way to do this is making use of a Web Setup Project. But how do we make this Web Setup Project suitable for multiple environments, because it's most likely that there are environments like Development, Test, Acceptance and Production.
The key to this solution is the "Condition" property. If you add a file to the Web Setup Project (In the File System view right mouse button on the Web Application Folder, then Add -> File) and select it you can find the "Condition" property in the properties window.
We add the following value to the "Condition" property ENV="Prod", this is for the production environment, for the test environment it will be something like this ENV="Test".
We also set the "TargetName" propery to Web.Config so the Web Setup Project will output the configuration file as Web.Config.
Well you can add unlimited Web.Config files to your Web Setup Project, they are all output as Web.Config but not all at the same time. So how can we choose the correct Web.Config for your environment, well like this:
%windir%\system32\msiexec.exe /i "Setup.msi" ENV="Prod"
- msiexec.exe (the Windows installer)
- /i (is the install switch)
- "Setup.msi" (compiled output of the Web Setup Project)
- ENV="Prod" (the condition value).
If you run this the setup will be started, after the setup is finished you will notice that only the Web.Config is installed with the "Condition" property set to ENV="Prod".
To make this all fool proof you can make a shortcut to this command line, like this:
Now when you click on this shortcut you get the same result.
So with this solution you can make one Web Setup Project for all your environments and create a better and stable deployment solution.
Yesterday jQuery released their new version, number 1.3. They did a lot af changes / bugfixing, performance improvements.
The big features are:
- Sizzle: A sizzlin’ hot CSS selector engine.
- Live Events: Event delegation with a jQuery twist.
- jQuery Event Overhaul: Completely rewired to simplify event handling.
- HTML Injection Rewrite: Lightning-fast HTML appending.
- Offset Rewrite: Super-quick position calculation.
- No More Browser Sniffing: Using feature detection to help jQuery last for many more years to come.
They did a pretty good job on the performance:
Selector performance, 49% faster:
Delegation filtering performance, 30x times faster:
Element insertion performance, 6x faster:
Offset rewrite, 3x times faster:
There is also a new API browser released with the following features:
- All the latest jQuery and jQuery UI documentation.
- The ability to mark pages as favorites for those pages you keep wanting to return to.
- Syntax highlighting in the code examples
- Live running of examples within the browser
- Links to edit and experiment with the code examples
You can find it here:
http://api.jquery.com/
The new version you can download here:
Downloading jQuery
Or you can use the google hosted version:
Google AJAX Libraries API
More info:
Blog: jQuery 1.3 and the jQuery foundation
Release notes
Most people use alert() to debug their JavaScript, but the Microsoft Ajax Library has a better alterative Sys.Debug. Sys.Debug has some methods for logging messages to the browser console. Like this:
To log a message:
Sys.Debug.trace(“Log to the console”)
To log an object:
Sys.Debug.traceDump(someObject);
You can use Web Development Helper for IE, and Firebug for Firefox to see your console messages. Or use textarea element with the id "TraceConsole" to trace your messages:
<textarea id=”TraceConsole” rows=”50” cols=”50”></textarea>
From:
http://weblogs.asp.net/alnurismail/archive/2009/01/12/a-better-alternative-to-using-alert-for-debugging.aspx
More Posts