April 2007 Blog Posts
When you are delaing with a Repeater or GridView and you have a string which contains embedded Carriage Returns and Line Feeds (CRLF) and you want to display that data using the CRLF you must change them to <BR> tags.
This can be acheived by the simple line below.
Eval("FieldName").ToString().Replace("\r\n", "<BR>")
Normally when you embed data from a database you may use the following Bind But Eval allows you to evaluate a complete expression.
A small sample is shown below <asp:Repeater ID="repComments" runat="server">
<HeaderTemplate><table cellspacing='0' cellpadding='0' width='650px'></HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label ID="lblName" CssClass="commentName" runat="server" Text='<%# Bind("CreatedBy") %>'></asp:Label>
</td>
<td align="right">
<asp:Label ID="Label1" CssClass="commentDate" runat="server" Text='<%# Bind("CreatedDateTimeUTC") %>'></asp:Label>
...
I was looking for some info on command line parameters for Access 2007 when I came across this help message.
Notice the important message.
No option is currently available!
Does that mean they are thinking of putting it back?, maybe the Ribbon is getting a lot of negative feedback despite the hype?
Telerik ( www.telerik.com ) makers of some great controls for Asp.net and WinForms have a content running now that will allow you the chance to win a 50" Plasma Television.
In order to participate you need to download RadControls for WinForms, explore the software for a while and then answer 10 easy questions.
For 5 or more correct answers, you will receive a complimentary RadControls for WinForms Developer License with Subscription and Source (value $999).
Enter the contest now
THE AWARDS:
Grand prize: 50 inch plasma TV
The first 50 participants that answer all questions...
Code Converter is a free and simple VB to C# and C# to VB code converter. While there are several other good code converters available, none are perfect. Some are buried in busy websites. Some are awkward to use. Some just don't convert accurately! Code Converter, while not yet perfect, aims to address these issues and provide the best free .NET converter available on the web.
Part of the mission of delivering the best code conversion service means that it needs to be available wherever and whenever you need it. For that reason, we will be building code conversion widgets for...
Firefox's extensions use a specific mime type and unless you add this you will not be able to download from an IIS 6+ web site.
Extension
:
.xpi
...
Step by Step Instructions for upgrading a COMPAQ IPAQ 3870 from Pocket PC 2002 to Pocket PC 2003 ( English )
The following instructions should help you perform this action in under 20 minutes on Windows XP ( see notes about Vista later )
Download the Upgrade/Patch files from http://blog.crowe.co.nz/attachments/nk.nb0.zip The file to download is called nk.nb0.zip and is ~16 MB in size
For those who think this is not legal see this message posted on the original forum where I found the details
...
I recieved the following error The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine on my Vista 64 bit machine today. I made no code changes since I run it on a 32 bit OS.
Aparantly there is not a 64bit Microsoft.Jet.OLEDB.4.0' provider and you have to force your build to 32 bit.
In the settings for the project under the Build Tab you must set Platform target to x86 instead of Any CPU
Scott Guthrie has an article on using Self Signed Certificates with IIS and how to enable it in under 30 seconds.
Here is a primer...
SSL enables browsers to communicate with a web-server over a secure channel that prevents eavesdropping, tampering and message forgery. You should always use SSL for login pages where users are entering usernames/passwords, as well as for all other sensitive pages on sites (for example: account pages that show financial or personal information).
Configuring SSL on Windows with previous versions of IIS has been a pain. Figuring out how to install and manage a certificate, and then associate it with a web-site,...
I saw a post on the MSDN Forums for Sidebar Gadget Development forum.
The post is available at this url:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1472545&SiteID=1
The user asked this question:
"Looking at the standard Microsoft Clock Sidebar Gadget, I was wondering whether it would be possible to change the jumping second-hand into a sweep second-hand, i.e. one that moves smoothly like an old mechanical clock or mechanical wrist watch. I looked into the code but had to give up after about two hours of trying. Anyone knoews hoe to do that? Thanks! "
You can download my re-write of the default Clock to support smooth scrolling seconds.
Download Now
I have been trying to get my main gadget Javascript page to be able to call a function in the flyout page.
Note: You will want to put a try/catch around the code in case the flyout is actually not available since it was closed and would cause an exception
On the main gadget Javascript page I have a function which will call the function resetMarginLeft() in the flyout
function renderFlyout()
{
System.Gadget.Flyout.document.resetMarginLeft();
// Other Stuff
}
So that function above will call a method called resetMarginLeft() which belongs to the document object model (DOM) in the flyout.
Now the document object model (DOM) does not have such as method...
Find and contribute PInvoke signatures
PInvoke.net, meaning Platform Invoke, is a wiki used by around 50,000 .NET developers a month to find and contribute PInvoke signatures (also known as Declare statements in VB), type definitions, and any other information related to calling Win32, or other unmanaged APIs in managed code (languages such as C# or VB.NET).
As a wiki, it is user driven and acts as a repository where developers can contribute or retrieve information as they wish.
Copy and paste your way to productivity
Certain things just can't be done in pure .NET, and the developer has to drill...
Download the Best Of SQL Server Central vol 3 which contains information about:
Security - both an overview and a detailed approach to securing your SQL Server.
Performance - key concepts and detailed explanations about how to improve the performance of your SQL Server.
Administration - tips and tricks for making the administration of SQL Server work for you, including some strong information about clustering.
You must register wth Red Gate Software who by the way make some great tools for managing your SQL Server Databases.
You can also download...
You may find that on occasion you can not view the content of CHM files on Windows Vista. You can see the table of contents but the actual details are not displayed.
This can occur if the file has come from another computer, and the OS now blocks these from running. CHM is not the only file that can be affected I have seen this issue with Javascript files that are used in Vista Gadgets.
You can click the Unblock button and it will allow the single file to be trusted.
In addition, check that the path to the .CHM...
Google Analytics provides powerful tracking for anyone with a web presence, whether it be a small hobby website or a giant online enterprise. It's one of the most powerful web analytics solutions on the market - and it's free for anyone to use!
Google Analytics provides in-depth reports for everyone involved in the running of a website, from the developers and designers to the marketing and management teams. Find out where people leave your site, and what content catches their attention. Compare marketing campaigns and see your return on investment for all of your AdWords spend. The ways that you can...
For those that do not know Developer Express make some really great tools and controls for .NET. They have made their Refactor tool for ASP.NET available for free.
Refactor! is freely available to all ASP.NET 2.0 developers and offers a comprehensive suite of tools that enable you and your team to simplify and shape complex code and HTML markup - making your web applications easier to read and less costly to maintain.
Below is a simple example where you can refactor the source file the .APSX file into a code behind file.
If you want to watch a small 12 minute video...
I originally disabled comments on this site by hacking around with the SQL. The reason SPAM
I have now enabled comments again - hopefully SPAMMERS will just stay away!
Well within 15 minutes of opening up the comments - 5 SPAM Comments!
I have been using an old OKIPage 8Z for a while since I do not do a lot of pritning from home. I originally has problems with drivers for that for 2003 server. No new drivers were ever released for 2003 Server.
I decided to splash out and buy a Fuji Xerox Docuprint 203a A4 Mono Laser Printer for the sum of $99+GST
This little printer looks nice and doesn't have a huge footprint but a lot more than the OKI, but then this is a laser printer.
Well I now only run VISTA, no more XP around here. I went to...
I found today that there was a new Blog Engine based on .TEXT called SubText.
Subtext is a personal blog publishing platform that focuses on usability, elegance, and simplicity. If you’ve ever caught yourself throwing your hands in the air and declaring that you’re going to write your own blogging engine, then Subtext is for you
I decided to give it a go and you are seeing the result right now. I like the changes in this product especially the SPAM filtering for comments.
I have reproduced the skin that I was using (well some of it ) and I am very happy....
I came across a forum that has a special topic on reproducable bugs in the Windows Vista Sidebar.
Most of the bugs have a work around so well worth a look if you are experiencing some strange issues with Vista Gadget development.
Here is a current list of bugs
Bug# 1: The bottom and right are incorrectly cropped when rotation is applied to <g:background>Bug# 2: <g:background> and addImageObject incorrectly place the image, by (originalImageWidth-scaledImageWidth)/2, (originalImageHeight-scaledImageHeight)/2Bug# 3: Image exploded beyond belief. Sidebar cannot resize an image smaller than 50% of it's original sizeBug# 4: Gadgets will not install if they contain blank directories in...
Here is a quick reference for the steps in HTTP pipeline in ASP.NET 2.0. Some of the steps are internal (cannot be subscribed by HTTP modules or GLOBAL.ASAX):
Internal step to validate request. Protects against malicious attacks exploiting path canonicalization
Internal step to perform URL mapping (if the URL mapping feature is enabled)
Fire BeginRequest event
Fire AuthenticateRequest event
Fire DefaultAuthentication internal event
Fire PostAuthenticateRequest event
Fire AuthorizeRequest event
Fire PostAuthorizeRequest event
Fire ResolveRequestCache event
Fire PostResolveRequestCache event
Internal step to determine the IHttpHandler to process the current request (this is when the page compilation takes place)
Fire PostMapRequestHandler event
Fire...
Here is a very simple gadget that shows how to play a stream from an ASX file that is in the Gadget folder for the current gadget.
It is very basic
CSS File
body|{ font-family: Segoe UI, Tahoma, Sans-Serif; width:130px; height:62px; margin:0px; padding:0px; background-color: white; border: ridge 2px font-size: 8pt;}
HTML File
<html><head><title>ASX Player< FONT>title>\<link href="css/Radio.css" rel="stylesheet" type="text/css" /><script language="javascript" src="js/Radio.js" type="text/javascript">< FONT>script>< FONT>head>
<body>This is a simple sample of how to play an ASX file <a href="javascript:void" onclick="startStream()">click here to start stream< FONT>a>
<OBJECT id="mediaPlayer" width="0" height="0" style="position:absolute; left:0;top:0;" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"type="application/x-oleobject"> <PARAM NAME="SendPlayStateChangeEvents" VALUE="True"><PARAM NAME="AutoStart" VALUE="False"><PARAM name="uiMode" value="invisible">< FONT>OBJECT>
< FONT>body>< FONT>html>
Javascript File
function startStream(){ mediaPlayer.url = System.Gadget.path+\\asx.asx;...
UPDATED:
AIR NEW ZEALAND have made their RSS feed unusable as it contains no details any more of the prices, flights etc and hence this gadgetno longer has any value unless you want to see the source code!
I have written another Windows Vista Gadget, this time at the request of Darryl Burling who works for Microsoft New Zealand. He asked if I could turn the RSS feed on the Grab A Seat site into a gadget. The gadget I have written requests the feed every 5 minutes and just displays what is available, never actually storing the feed but just consuming it. The items...
I have been playing aroung with Windows Vista Gagets lately and have currently written about 10. Some are for my work - simple things like who is on Helpdesk duty today, and another for our IS Severity system that will show up planned outages and unplanned outages, colour coded based on the rating of the problem. This is similar to an RSS feed except the data is always live and not cached so that when a job is closed it is removed from the list.
Another is the Weather Gadget for http://weather.cobbnz.com, a collegue at works owns the site and I have...
I have created a simple example of a Windows Vista Gadget that will talk to SQL Server using OLEDB with ADO.
This code is very similar to code that one would have used in the past with writing code for ASP pages.
The code is written in Javascript and DHTML.
Basicall the code works like this:
The gadget has an HTML body tag and we assign an onload event to it to trigger our Javascript code which will talk to SQL Server and render all the categories from the Northwind database.
Our simple code in the loadMain event is as follows:
function loadMain(){var serverName =...
I came across an interesting message in a forum and tried it out and it works.
I was very annoyed that NTBackup was removed from Vista. The new backup solution just does not give me flexibility I want. So I went and figured what files you need from XP to run NTBackup on Vista. Turns out that you need the following files which all exist in c:\windows\system32
ntbackup.exe
ntmsapi.dll
ntmsdba.dll
vss_ps.dll
vssadmin.exe
vssapi.dll
vssvc.exe
You do get a popup when starting it still, but it all works. You can then also associate BKF files with ntbackup.exe to give them the NTBackup icon and there you go!
On your vista...
I came across a great tool for looking at colours and their complimentary colours, infact six types of compilimentary colours.
Place this HTML Color Code tool on your website free. | Professional Turnkey Websites
As you can see you can use the colour wheel live on this site, but you may also want to check out the site owners site at http://www.siteprocentral.com/html_color_code.html
This is a great tool and I hope people will find it usefull.