Posted by Anders Vindberg
in Lunarmedia Blog
on the 12 Feb. 2008
The first thought would be to use the CSControls:LinkData (or CSLinkData) control and specify the resourceName. The second logical solution would be using the ResourceControl defining that it should act as a link. None of this works.
The solution is to use the SiteUrl control and specify the UrlName:
<CSControl:SiteUrl UrlName="upload" Text="" runat="server" />
The example above refers to the SiteUrls/locations/location/url node in SiteUrls.Config with the name "upload".
Posted by Anders Vindberg
in Lunarmedia Blog
on the 04 Feb. 2008
Rightclick in the Scheduled Tasks area and choose "New" -> "Scheduled Task". Then in the run field add the following:
sqlcmd -S .\SQLExpress -i c:\expressmaint.sql
In the sql file you can simply write: EXEC dbname.dbo.sp_AnyStoredProcedure.
Why don't just use SqlAgent you may ask. In SqlExpress the SqlAgent has been feature cut - because express is free.
Posted by Anders Vindberg
in Lunarmedia Blog
on the 23 Jan. 2008
When using Full-Text Indexing in MS-Sql you may find that search results for "the" or "saw" doesn't return any results. To resolve the issue, go to "properties" of the Full-Text index select "Columns" and change the "Language for Word Breaker" setting to "Neutral". If "English" is selected, then common English words are not indexed.
Posted by Anders Vindberg
in Lunarmedia Blog
on the 27 Nov. 2007
Working with Community Server a common task is to show content specific for a certain role user. Here is a simple example using a placeholder:
<CSControl:PlaceHolder runat="server">
<DisplayConditions>
<CSControl:UserPropertyValueComparison
ComparisonProperty="IsAdministrator"
UseAccessingUser="true"
Operator="isSetOrTrue"
runat="server" />
</DisplayConditions>
<ContentTemplate>
any content...
</ContentTemplate>
</CSControl:PlaceHolder>
Instead of "IsAdministrator" you could insert "IsAnonymous" in order to show content for unregistered users.
Posted by Anders Vindberg
in Lunarmedia Blog
on the 05 Nov. 2007
1. To enable HTTP Compression in IIS6 for all websites, open the IIS Manager, goto Properties of "Web Sites" and select the "Service" tab. Check the "Compress application files" and "Compress static files", and specify a location for the temp cache dir (if you want to). Maximum dir size is usually set to 1000MBs. Click "OK".
2. Then right-click on "Web Service Extensions" and add a new Web Service. Name it something like "HTTP Compression" and add the file "C:\WINDOWS\system32\inetsrv\gzip.dll". Check the "Set extension status to Allowed". Press "OK".
3. Then right-click on your server (local computer) and goto Properties. Check the "Enable Direct Metabase Edit". Press "OK".
4. Run this small batch - IIS6HttpCompressionSettings.zip (Made by me). It will add several common file extensions to the MetaBase.xml list so that e.g. css, js, axd, etc are included in the compression. And it will set compression level to 9 (is suggested by several .Net gurus).
In short, the batch runs several of these commands to make the appropriate changes: cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/gzip/HcFileExtensions "css" "xml" "htm" "txt"
Once you have run the batch, simply do an iisreset and you are finished.
Alternatively, If you want to change the MetaBase file manually open the file "C:\WINDOWS\system32\inetsrv\MetaBase.xml" and search for the "IIsCompressionScheme" xmlnode. In the first two nodes (deflate and gzip) change the HcDynamicCompressionLevel to 9. If you want compression of aspx files (most likely), then add "aspx" to the HcScriptFileExtensions in both xmlnodes. Be sure to follow the format that is already used (e.g. not inserting any blank spaces). Save the file and do an iisreset.
For more detailed explanation of the different steps please goto: http://weblogs.asp.net/owscott/archive/2004/01/12/57916.aspx For information about enable or disabling compression of a single website see more at Microsoft's Technet article on HTTP compression.
Posted by Anders Vindberg
in Lunarmedia Blog
on the 01 Nov. 2007
When customizing a theme in Community Server 2007.1 it is important to do a Find and Replace in the new Theme folder. E.g. If the leanandgreen theme is used as the basis of a new theme, do a Replace of "themes/leanandgreen" with "themes/mysitetheme". Unfortunately, several CS files still has hardcoded theme references which needs to be replaced with the new theme name.
In addition, it is important to edit the DynamicStyles.aspx file in the "style" folder of the new theme. It also contains hardcoded reference to the original theme. If this is not done, any Theme Configuration (from the control panel) will not have any effect on the website.
Posted by Anders Vindberg
in Lunarmedia Blog
on the 02 Sep. 2007
What Flash haven't been able to achieve is Silverlight's goal. Why haven't Flash replaced loosely structured HTML already!? Personally, I was expecting this to happen 10 years ago when I first saw a jumping ball made in Flash 2. Obviously, there were several barriers at that time, primarily the Shockwave Flash plug-in hadn't propagated the web yet. Further, competition has increased as HTML (the DOM) has evolved, CSS introduced and JavaScript enhanced. Flash simply wasn't up for the challenge of defining and laying out content in a accessible manor. Ohh well, maybe their focus was set differently - i guess they were, lets make games!
Having a browser-independent plug-in run on a platform-independent browser functioning as a platform for development is difficult enough to articulate so lets not even start to imagine how difficult it must be to develop. In the early days, 10 years ago, Flash was my candidate. Since then I found XHTML as the given choice. But seeing the latest version of Silverlight 1.1 portraying as a Windows-Mini downloadable plug-in for any browser on any OS (eventually) lifts my eyebrows. It is equal to mixing Java applets with Flash and most importantly setting content free! It is accessible in strict formatted XML, and so is most parts of the graphics (XAML) for development sharing (like HTML). In a way, you could say they are mimicking what's already happening on the open web with XHTML 2.0, so no credit to MS. But how big is this "threat"? They are doing everything by the book this time (given the fact that Google eventually will index Xaml files of course).
Posted by Anders Vindberg
in Lunarmedia Blog
on the 23 May. 2007
Are you in the need of testing your website in Safari (the WebKit layout engine), and sitting on windows machine, then look no further. First install the Apollo Runtime, and then grab the Apollo application called Scout, a small simplified browser that uses the WebKit layout engine. According to Adobe's FAQ, it uses the same layout engine as Safari on Mac OS X and KHTML Browser. For completeness, it should be noted that an early implementation of WebKit for windows called the Swift browser is no longer being developed on. Also, I have encountered a small layout divergence from Scout and older versions of Safari, so be aware of that.
Looking for a CSS Safari Hack (this in particular) I can inform this also works with Scout.
It seems that, as a web-developer, we need to compatibility-test with four chief engines:
- Trident - Internet Explorer
- Gecko - Mozilla Firefox
- WebKit - Safari/Apollo
- Presto - Opera
At least running on a windows machine we can now test each rendering engine in one go.
Posted by Anders Vindberg
in Lunarmedia Blog
on the 12 May. 2007
Lately I have changed several of my primary bookmarks. For instance, my link to Digg.com is now http://digg.com/#wrapper, iGoogle is https://www.google.com/ig#tabs and Noscope is http://noscope.com/#main - it takes me right to the content im interested in. It seems to be an overlooked benefit of hypertext that it is possible to anchor-link to element id's whether or not it the original purpose of these id's. Come to think about it, maybe we need a new attribute indicating that this specific HTML element is a anchorpoint on to which a user could link to (instead of looking in the source as I have). It could be implemented in the same way RSS-feeds are today - Mozilla are you reading this :)
Posted by Anders Vindberg
in Lunarmedia Blog
on the 11 May. 2007
Prototype is a somewhat complex JavaScript library though thoroughly documented it still misses out on some points. For instance, I have a list of checkboxes for which at least one has to be checked. If none of the checkboxes in the group are checked then the user should receive a message indicating the missing action. At first, the most intuitive solution was to use the form.getValues() method in combination with a find() enumerator. However, that method can only loop through an entire form. So I needed a function that could loop through element groups within a form. As always best illustrated with an example:
<ul id="FF_Microsoft">
<li>
<input name="FF_MicrosoftDislike" id="FF_MicrosoftDislike" value="1" type="checkbox" />
<label for="FF_MicrosoftDislike">I generally dislike Microsoft</label>
</li>
<li>
<input id="FF_MicrosoftNone" type="checkbox" value="1" />
<label for="FF_MicrosoftNone">No, none of the above</label>
</li>
</ul>
With the following Javascript:
function IsChecked(el) {
return $$('#' + el + ' input').find(
function(e) {return e.checked;});
};
And in order to use the function you simply:
if(IsChecked('FF_Microsoft') != null)
{
// Do something
};
The naming used in the example may seem a bit strange (its from my upcoming questionnaire).
Posted by Anders Vindberg
in Lunarmedia Blog
on the 09 May. 2007
Yes, it is often that IE doesn't performe as it should! And often it is difficult to debug the error. Lately I was receiving a "object doesn't support this property or method.." error in IE6 when the Ajax open() method was called. It works just fine in Firefox and IE7 but IE6 was not saving any data. It should be noted that I am using the Prototype library which automatically retrieves the correct XMLHTTP-REQUEST object. So far so good. The relevant part was in another place. Im on a Win 2003 box and I un-installed IE7. In short, the solution was to reset the security configuration of IE6 to Medium. Somehow, the settings left from the IE7 install had triggered a setting that caused the Ajax to fail.
I hope this helps someone, spend all day on it Grrh!
Posted by Anders Vindberg
in Lunarmedia Blog
on the 03 May. 2007
Silverlight (formerly known as WPF/E) is on the move. If you need hosting for your Silverlight apps, Microsoft is supplying 4GB of free space at https://silverlight.live.com/?wa=wsignin1.0. For quick insight into development of Silverlight apps in Visual Studio see this video by Scutt Gu. With regard to Community Server, Bryant Likes is working on a Silverlight CSModule to ease the task of inserting Silverlight in blogposts.
The battleground has been defined by all contestants (Apollo/Flex, Silverlight), and the answer is untold, who will win the heart of developers? Who will win this API-war? And does it matter? When it comes to entertainment, maybe it does, but what concerns information I think HTML5/XHTML2 will prevail.
Posted by Anders Vindberg
in Lunarmedia Blog
on the 30 Apr. 2007
It is easier than ever to enable http compression in dotnet 2.0 using an open Http Module from Blowery called HttpCompression. However, one should be aware to exclude a couple of files, in particular axd files as errors has been reported when compressing javascript files. Simply add this to the web.config:
<excludedPaths>
<add path="WebResource.axd"/>
</excludedPaths>
A tutorial on how to use the compression module, see this article
Posted by Anders Vindberg
in Lunarmedia Blog
on the 29 Apr. 2007
About 3-4 months ago I decided to get a professional branding company to take on Lunarmedia. It is what has materialized into what you see now, the new Lunarmedia website and a dedicated direction towards becoming a true dot-com company. I will bring detailed information about the transformation on a later date. As of now, the progress below (four rockets) illustrates how the logo came into being:
Overall this has been a good experience but it always come as a surprise each time I endeavor on launching or upgrading a website - it takes a great deal of time to get all the pieces together, the database setup, the graphics, the markup, all the settings, and so forth. Not to mention the content - authoring - that needs to be formalized.
On a conclusive note, it is amazing to have brought Lunarmedia's new identity into life! Personally I think it looks great and have good feeling about it! What do you think?
Posted by Anders Vindberg
in Lunarmedia Blog
on the 12 Apr. 2007
I recently installed Web Deployment Project (uses MSBuild which automatically comes with .Net 2.0) for Visual Studio 2005 to automate the website deployment process. A useful extension pack for MSBuild is called Community Tasks - in particular it includes Zip and FtpUpload tasks. Now we are getting to the point. If you need to make a SSL ftp connection (and approve a self-signed server certificate) using the FtpUpload task, you need to extend the current version of FtpUpload with the following (request is a FtpWebRequest instance, and EnableSSL is a public property):
request.EnableSsl = EnableSSL;
// This approves any Server Certificate (self-signed)
ServicePointManager.ServerCertificateValidationCallback = delegate(Object obj, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
return true;
};
If you dont want to mess with the community.tasks.dll library you can download the new dll and accompanied schema files from here:MSBuild.Community.Tasks with SSL FtpUpload support
Thanks to the following: Using FtpWebRequest to do FTP over SSL
On a specific note, if using FTP Serv-U you need to set its security level to "Allow SSL/TLS and regular sessions" to enable Auth TLS.