<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css" href="http://www.morrenth.com/Data/style/rss1.css" ?> <?xml-stylesheet type="text/xsl" href="http://www.morrenth.com/Data/xsl/rss1.xsl" ?>
<!--RSS generated by mojoPortal Blog Module V 1.0 on Monday, February 06, 2012-->
<rss version="2.0">
  <channel>
    <title>Beyond the boundaries of ASP.Net development</title>
    <link>http://www.morrenth.com/blog.aspx</link>
    <description />
    <copyright />
    <ttl>120</ttl>
    <managingEditor />
    <generator>mojoPortal Blog Module V 1.0</generator>
    <item>
      <title>Validating a Custom Server Control</title>
      <link>http://www.morrenth.com/1validating-a-custom-server-control.aspx</link>
      <pubDate>Fri, 02 Dec 2011 13:06:40 GMT</pubDate>
      <guid>http://www.morrenth.com/1validating-a-custom-server-control.aspx</guid>
      <comments>http://www.morrenth.com/1validating-a-custom-server-control.aspx</comments>
      <description><![CDATA[<p><font size="2">If you need to make a custom server control target of ASP.NET Validation, just add the Attribute </font></p>
<p><code><i><font size="2">[<b>ValidationProperty("Text")</b>]</font></i><br />
<i>public class CustomControl : CheckboxList<br />
&#160;&#160;&#160; { yadayada... }</i></code></p>
<p><font size="2">to the class definiton</font> of the control to tell the ASP.Net validation framework what value to validate...simple, huh? Just replace the "Text" in the live above with the Property of your custom control to be validated.</p><br /><br /><a href='http://www.morrenth.com'>Florian Morrenth</a>&nbsp;&nbsp;<a href='http://www.morrenth.com/1validating-a-custom-server-control.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>Script to Backup Zip and FTP SQL Server Database</title>
      <link>http://www.morrenth.com/script-to-backup-zip-and-ftp-sql-server-database.aspx</link>
      <pubDate>Thu, 22 Sep 2011 21:48:34 GMT</pubDate>
      <guid>http://www.morrenth.com/script-to-backup-zip-and-ftp-sql-server-database.aspx</guid>
      <comments>http://www.morrenth.com/script-to-backup-zip-and-ftp-sql-server-database.aspx</comments>
      <description><![CDATA[<p>Here is a sql server script that makes compressed backups and moves them to an FTP. Quick and drity solution for the paranoic lone developer who's system just crashed...</p>
<p>There are only 2 preconditions: <a href="http://www.7-zip.org/download.html">7-zip</a> installed and xp-cmdshell enabled (see <a href="http://www.sql-server-performance.com/2006/enable-xp-cmdshell-2005/">this</a>).</p>
<p>&#160;</p>
<p><code><i>USE MASTER</i></code></p>
<p><code><i>CREATE procedure spBackupAndFtpDB<br />
@FTPServer&#160;&#160; &#160;varchar(128) ,<br />
@FTPUser&#160;&#160; &#160;varchar(128) ,<br />
@FTPPWD&#160;&#160; &#160;&#160;&#160; &#160;varchar(128) ,<br />
@FTPPath&#160;&#160; &#160;varchar(128) = '/' ,<br />
@DBList&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;varchar(MAX),<br />
@Delimiter&#160;&#160; &#160;varchar(MAX) = ',',<br />
@ZipBackup&#160;&#160; &#160;bit = 1,<br />
@DelteLocalFiles bit = 1,<br />
@workdir&#160;&#160; &#160;varchar(128) = 'C:\Windows\Temp\', <br />
@7zipdir&#160;&#160; &#160;varchar(255) = 'C:\Program Files\7-zip\'<br />
<br />
as<br />
&#160;&#160; &#160;-- deal with special characters for echo commands<br />
&#160;&#160; &#160;select @FTPServer = replace(replace(replace(@FTPServer, '|', '^|'),'&lt;','^&lt;'),'&gt;','^&gt;')<br />
&#160;&#160; &#160;select @FTPUser = replace(replace(replace(@FTPUser, '|', '^|'),'&lt;','^&lt;'),'&gt;','^&gt;')<br />
&#160;&#160; &#160;select @FTPPWD = replace(replace(replace(@FTPPWD, '|', '^|'),'&lt;','^&lt;'),'&gt;','^&gt;')<br />
&#160;&#160; &#160;select @FTPPath = replace(replace(replace(@FTPPath, '|', '^|'),'&lt;','^&lt;'),'&gt;','^&gt;')<br />
&#160;&#160; &#160;<br />
&#160;&#160; &#160;declare&#160;&#160; &#160;@cmd varchar(1000)<br />
&#160;&#160; &#160;declare @workfilename varchar(128)<br />
&#160;&#160; &#160;<br />
&#160;&#160; &#160;DECLARE @SourceFile varchar(255)<br />
&#160;&#160; &#160;<br />
&#160;&#160; &#160;create table #a (id int identity(1,1), s varchar(1000))<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; <br />
<br />
&#160;&#160; &#160;--start loop<br />
&#160;&#160; &#160;DECLARE @CSVString varchar(MAX);<br />
&#160;&#160; &#160;SET @CSVString = @DBList<br />
<br />
&#160;&#160; &#160;DECLARE @pos INT;<br />
&#160;&#160; &#160;DECLARE @DB VARCHAR(MAX);<br />
<br />
&#160;&#160; &#160;SELECT @pos = 1;<br />
<br />
&#160;&#160; &#160;WHILE @pos!= 0<br />
&#160;&#160; &#160;BEGIN<br />
&#160;&#160; &#160;&#160;&#160;&#160; SET @pos = CHARINDEX(@Delimiter,@CSVString);<br />
&#160;&#160; &#160;&#160;&#160;&#160; IF @pos != 0<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; SET @DB = LTRIM(RTRIM(LEFT(@CSVString, @pos - 1)));<br />
&#160;&#160; &#160;&#160;&#160;&#160; ELSE<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; SET @DB = LTRIM(RTRIM(@CSVString));<br />
<br />
&#160;&#160; &#160;&#160;&#160;&#160; IF( LEN(@DB) &gt; 0)<br />
&#160;&#160; &#160;&#160;&#160;&#160; BEGIN<br />
<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; --backup&#160;&#160; &#160;<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; SET @SourceFile = @DB + CONVERT(VARCHAR(6), GETDATE(), 12) + '.bak'<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; SELECT @cmd = 'BACKUP DATABASE [' +&#160;&#160; @DB + '] TO&#160; DISK = N''' + @workdir + @SourceFile + ''' WITH NOFORMAT, INIT,&#160; NAME = N''' + @DB + '-Full Database Backup'', SKIP, NOREWIND, NOUNLOAD,&#160; STATS = 100'<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; EXEC (@cmd)<br />
<br />
<br />
<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; --compress<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; IF @ZipBackup = 1 BEGIN<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; SELECT @cmd = '"' + @7zipdir +'7z" a ' + @workdir + @SourceFile + '.7z ' + @workdir + @SourceFile<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; print @cmd<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; insert #a<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; exec master..xp_cmdshell @cmd<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; IF @DelteLocalFiles = 1<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; BEGIN<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; --remove backup<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; SELECT @cmd = 'del "' + @workdir + @SourceFile + '"'<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; print @cmd<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; insert #a<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; exec master..xp_cmdshell @cmd<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; END<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; <br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; --set zipped sourcefile<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; SELECT @SourceFile = @SourceFile + '.7z'<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; END<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; <br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; <br />
<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; --ftp<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; select @workfilename = 'ftpcmd.txt'<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; <br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; select&#160;&#160; &#160;@cmd = 'echo '&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;+ 'open ' + @FTPServer<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; + ' &gt; ' + @workdir + @workfilename<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; exec master..xp_cmdshell @cmd<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; select&#160;&#160; &#160;@cmd = 'echo '&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;+ @FTPUser<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; + '&gt;&gt; ' + @workdir + @workfilename<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; exec master..xp_cmdshell @cmd<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; select&#160;&#160; &#160;@cmd = 'echo '&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;+ @FTPPWD<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; + '&gt;&gt; ' + @workdir + @workfilename<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; exec master..xp_cmdshell @cmd<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; select&#160;&#160; &#160;@cmd = 'echo '&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;+ 'put ' + @workdir + @SourceFile + ' ' + @FTPPath + @SourceFile<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; + ' &gt;&gt; ' + @workdir + @workfilename<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; exec master..xp_cmdshell @cmd<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; select&#160;&#160; &#160;@cmd = 'echo '&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;+ 'quit'<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; + ' &gt;&gt; ' + @workdir + @workfilename<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; exec master..xp_cmdshell @cmd<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; <br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; print @cmd<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; select @cmd = 'ftp -s:' + @workdir + @workfilename<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; <br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; insert #a<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; exec master..xp_cmdshell @cmd<br />
<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; <br />
--Not logged in. <br />
--Login failed.<br />
--File not found <br />
<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; IF @DelteLocalFiles = 1<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; BEGIN<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; --remove backup<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; SELECT @cmd = 'del "' + @workdir + @SourceFile + '"'<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; print @cmd<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; insert #a<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; exec master..xp_cmdshell @cmd<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; END<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; <br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; <br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; --report results<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; SELECT id, ouputtmp = s FROM #a WHERE s IS NOT NULL<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; <br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; IF EXISTS(SELECT * FROM #a WHERE s LIKE '%Not logged in%' OR s LIKE '%Login failed%' OR s LIKE '%File not found%' OR s like '%WARNINGS for files%')<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; BEGIN<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; SET @cmd = 'An Error occured during Backup and FTP. Details: '<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; SELECT @cmd = @cmd + '; ' + ISNULL(s, '') FROM #a WHERE s IS NOT NULL<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; RAISERROR (@cmd, -- Message text.<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; 16, -- Severity.<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; 1 -- State.<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; );<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; END<br />
&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; <br />
<br />
&#160;&#160; &#160;&#160;&#160;&#160; END<br />
<br />
&#160;&#160; &#160;&#160;&#160;&#160; SET @CSVString = RIGHT(@CSVString, LEN(@CSVString) - @pos);<br />
&#160;&#160; &#160;END<br />
&#160;&#160; &#160;<br />
&#160;&#160; &#160;<br />
&#160;&#160; &#160;RETURN 0<br />
&#160;&#160; &#160;<br />
go</i></code></p><br /><br /><a href='http://www.morrenth.com'>Florian Morrenth</a>&nbsp;&nbsp;<a href='http://www.morrenth.com/script-to-backup-zip-and-ftp-sql-server-database.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>Custom SiteMapDataSource Menu</title>
      <link>http://www.morrenth.com/custom-sitemapdatasource-menu.aspx</link>
      <pubDate>Sat, 12 Mar 2011 07:47:18 GMT</pubDate>
      <guid>http://www.morrenth.com/custom-sitemapdatasource-menu.aspx</guid>
      <comments>http://www.morrenth.com/custom-sitemapdatasource-menu.aspx</comments>
      <description><![CDATA[<p>I just ran into a problem with a weird historically grown ASP.NET website that has been originally written in ASP. Therefore little of the markup and code was REAL ASP.NET. For example &lt;form runat="server"&gt; tags were only rudimentary implemented. &lt;asp:Menu&gt; Control wouldn't work outside a &lt;form&gt; tag. So before messing with the site (as messy as it was - it worked) I created my own &lt;ul&gt; based menu control which was apparently very easy:<br />
<code>&lt;asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" /&gt;<br />
&lt;asp:Repeater ID="Repeater1" runat="server" DataSourceID="SiteMapDataSource1" EnableViewState="false"&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;HeaderTemplate&gt;&lt;ul id="menu" class="menu"&gt;&lt;/HeaderTemplate&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ItemTemplate&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;li&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;a class="menulink" href='&lt;%#Eval("url")%&gt;'&gt;&lt;span&gt;&lt;%#Eval("Title")%&gt;&lt;/span&gt;&lt;/a&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ul&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:Repeater ID="bar" DataSource='&lt;%#Container.DataItem.ChildNodes()%&gt;' runat="server"&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ItemTemplate&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;li&gt;&lt;a class='&lt;%# String.Format("{0}", IIF(Container.DataItem.HasChildNodes(), "sub", String.Empty)) %&gt;' href='&lt;%#Eval("url")%&gt;'&gt;&lt;span&gt;&lt;%#Eval("Title")%&gt;&lt;/span&gt;&lt;/a&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ul&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:Repeater ID="bar" DataSource='&lt;%#Container.DataItem.ChildNodes()%&gt;' runat="server"&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ItemTemplate&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;li&gt;&lt;a class='&lt;%# String.Format("{0}", IIF(Container.DataItem.PreviousSibling() IS Nothing, "topline", String.Empty)) %&gt;' href='&lt;%#Eval("url")%&gt;'&gt;&lt;span&gt;&lt;%#Eval("Title")%&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/ItemTemplate&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/asp:Repeater&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/ul&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/li&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/ItemTemplate&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/asp:Repeater&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/ul&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/li&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/ItemTemplate&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;FooterTemplate&gt;&lt;/ul&gt;&lt;/FooterTemplate&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/asp:Repeater&gt;</code></p>
<p>Note: No Codebehind needed! And jsut add a little .js and .css found <a href="http://www.noupe.com/tutorial/drop-down-menu-jquery-css.html">here</a> and my menu was able to render without a &lt;form&gt; tag. Hooray. That saved the day!</p><br /><br /><a href='http://www.morrenth.com'>Florian Morrenth</a>&nbsp;&nbsp;<a href='http://www.morrenth.com/custom-sitemapdatasource-menu.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>Inline Select Comma Separated List (CSV) fom Table </title>
      <link>http://www.morrenth.com/inline-select-comma-separated-list-csv-fom-table-.aspx</link>
      <pubDate>Tue, 26 Oct 2010 09:44:12 GMT</pubDate>
      <guid>http://www.morrenth.com/inline-select-comma-separated-list-csv-fom-table-.aspx</guid>
      <comments>http://www.morrenth.com/inline-select-comma-separated-list-csv-fom-table-.aspx</comments>
      <description><![CDATA[<p>in SQL Server without using a function as seen on <a href="http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/">Sql Authority</a>...I just love it's simplicity</p>
<p><code><b>(SELECT STUFF((SELECT ', ' + Type FROM dbo.Reactor r FOR XML PATH('')),1,1,''))</b></code><b><br />
</b></p><br /><br /><a href='http://www.morrenth.com'>Florian Morrenth</a>&nbsp;&nbsp;<a href='http://www.morrenth.com/inline-select-comma-separated-list-csv-fom-table-.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>"The custom tool 'MSLinqToSQLGenerator' failed. Unspecified error"</title>
      <link>http://www.morrenth.com/the-custom-tool-mslinqtosqlgenerator-failed-unspecified-error.aspx</link>
      <pubDate>Mon, 18 Oct 2010 08:26:11 GMT</pubDate>
      <guid>http://www.morrenth.com/the-custom-tool-mslinqtosqlgenerator-failed-unspecified-error.aspx</guid>
      <comments>http://www.morrenth.com/the-custom-tool-mslinqtosqlgenerator-failed-unspecified-error.aspx</comments>
      <description><![CDATA[<p><span>When you have a custom partial class attached to the LINQ2SQL file, Visual Studio will delete the corresponding ".designer.cs" file  for your data context and nothing will compile after that point. You can either rename that file every time you make changes or </span><span><br />
move the "<b>using</b>" statements of your <b>custom partial class INSIDE the namespace</b> declaration - and then it works!             </span></p>
<p><code><span>namespace Data<br />
{<br />
<b>&#160;&#160;&#160; using System.Data.Linq.Mapping;<br />
&#160;&#160;&#160; using System.Data.Linq;<br />
&#160;&#160;&#160; using System.Reflection;</b><br />
&#160;&#160;&#160; partial class MyDataContext<br />
&#160;&#160;&#160; {</span></code></p>
<p><code>...</code></p>
<p><code>}</code></p><br /><br /><a href='http://www.morrenth.com'>Florian Morrenth</a>&nbsp;&nbsp;<a href='http://www.morrenth.com/the-custom-tool-mslinqtosqlgenerator-failed-unspecified-error.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>zh invariant chinese culture</title>
      <link>http://www.morrenth.com/zh-invariant-chinese-culture.aspx</link>
      <pubDate>Fri, 30 Jul 2010 12:48:14 GMT</pubDate>
      <guid>http://www.morrenth.com/zh-invariant-chinese-culture.aspx</guid>
      <comments>http://www.morrenth.com/zh-invariant-chinese-culture.aspx</comments>
      <description><![CDATA[<p>I just ran into a problem with auto generated Resource Classes for <strong>.resx</strong> files in the <strong>App_GlobalResources</strong> folder. By default the runtime generates Proxy classes to access the content of neutral sample.resx files by code. If you add other languages (e.g. German like sample<strong>.de</strong>.resx) this file is recognized as a language specific version of the neutral file and no proxy is generated. <em>This is fine.</em></p>
<p>Problem: If you add a sample.zh.resx for the Chinese version you get an error <strong><em>"...already contains a definition for...</em>" because there is no invariant zh culture!</strong> So the runtime tries to generate a neutral proxy...for most languages there is an invariant version (<a href="http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo%28VS.71%29.aspx">http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo%28VS.71%29.aspx</a>) but not for Chinese. You have to choose a specific culture instead. e.g. <strong>zh-CHS</strong> for traditional Chinese.</p><br /><br /><a href='http://www.morrenth.com'>Florian Morrenth</a>&nbsp;&nbsp;<a href='http://www.morrenth.com/zh-invariant-chinese-culture.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>Checking .NET Framework version installed on webserver</title>
      <link>http://www.morrenth.com/checking-net-framework-version-installed-on-webserver.aspx</link>
      <pubDate>Mon, 29 Mar 2010 07:21:12 GMT</pubDate>
      <guid>http://www.morrenth.com/checking-net-framework-version-installed-on-webserver.aspx</guid>
      <comments>http://www.morrenth.com/checking-net-framework-version-installed-on-webserver.aspx</comments>
      <description><![CDATA[<p>To <strong>check </strong>your target <strong>web server</strong> environment for installed <strong>CLR versions</strong> you can use the follogin script which runs through the registry to determine the installes CLR versions on a host. Just paste the text below into a .aspx file. That' all.</p>
<p><code>&lt;%@ Page Language="VB" %&gt;<br />
&lt;%@ Import Namespace="Microsoft.Win32" %&gt;<br />
<br />
&lt;script runat="server"&gt;<br />
&#160;&#160;&#160; Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim componentsKeyName As String = "SOFTWARE\Microsoft\NET Framework Setup\NDP"<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim componentsKey As RegistryKey = Registry.LocalMachine.OpenSubKey(componentsKeyName)<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim instComps As String() = componentsKey.GetSubKeyNames()<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; For Each instComp As String In instComps<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim key As RegistryKey = componentsKey.OpenSubKey(instComp)<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; If instComp IsNot Nothing AndAlso instComp.StartsWith("v") Then<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; lblVersion.Text = lblVersion.Text &amp; instComp &amp; " SP " &amp; key.GetValue("SP") &amp; ", "<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; End If<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; Next<br />
&#160;&#160;&#160; End Sub<br />
&lt;/script&gt;<br />
<br />
&lt;html&gt;<br />
&lt;head runat="server"&gt;&#160; &#160;<br />
&#160;&#160;&#160; &lt;title&gt;CLR Versions&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&#160;&#160;&#160; &lt;form id="form1" runat="server"&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:Label ID="lblVersion" runat="server"&gt;Your server is running ASP.NET and the versions are: &lt;/asp:Label&gt;<br />
&#160;&#160;&#160; &lt;/form&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</code><br />
<br />
<br />
<br />
<br />
&#160;</p><br /><br /><a href='http://www.morrenth.com'>Florian Morrenth</a>&nbsp;&nbsp;<a href='http://www.morrenth.com/checking-net-framework-version-installed-on-webserver.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>Full Text Search for PersonalizationProvider</title>
      <link>http://www.morrenth.com/1full-text-search-for-personalizationprovider.aspx</link>
      <pubDate>Thu, 10 Dec 2009 06:06:51 GMT</pubDate>
      <guid>http://www.morrenth.com/1full-text-search-for-personalizationprovider.aspx</guid>
      <comments>http://www.morrenth.com/1full-text-search-for-personalizationprovider.aspx</comments>
      <description><![CDATA[<p>With custom Personalization Providers  it's easy to create your custom store (DB, XML, flat file, etc) eg. for editable Web Parts. But you get only a BLOB created by the WebPartManager to deal (store, retrieve, clear, etc) with and cannot read the actual content of the Personalization. This is why you cannot create a Full Text Search over personalized Web Pages easily. To achieve this you have to deserialize the WebPartManager's BLOB which format is kind of cryptic and not documented. So I used Lutz Roeder 's <a title=".Net Reflector" href="http://www.morrenth.com/SharedFiles/Download.aspx?pageid=5&amp;fileid=5&amp;mid=17">.Net Reflector</a> before it was bought by Red Get sneaked into Microsoft's Code and extracted the relevant code for Serialization and Deserialization of these BLOBs.</p>
<p>Here is a schematic overview of what you can do with this Full Text Personalization Provider Framework. Download sample Project to support Full Text Search. All you need to do is implement your custom storage: <a title="Custom Personalization with Full Test Support" href="../SharedFiles/Download.aspx?pageid=5&amp;fileid=4&amp;mid=17">CustomPersonalization.zip</a></p>
<p><img title="Full Text Personalization Provider" src="http://www.morrenth.com/Data/Sites/1/personalizationprovider.gif" alt="" width="757" height="525" /></p><br /><br /><a href='http://www.morrenth.com'>Florian Morrenth</a>&nbsp;&nbsp;<a href='http://www.morrenth.com/1full-text-search-for-personalizationprovider.aspx'>...</a>]]></description>
    </item>
  </channel>
</rss>
