<feed xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
    <title>David Madden</title>
    <link rel="self" type="application/xml" href="http://geekswithblogs.net/DavidMadden/Atom.aspx" />
    <subtitle type="html">Mastering the craft one mountain at a time.</subtitle>
    <id>http://geekswithblogs.net/DavidMadden/Default.aspx</id>
    <author>
        <name>DavidMadden</name>
        <uri>http://geekswithblogs.net/DavidMadden/Default.aspx</uri>
    </author>
    <generator uri="http://subtextproject.com" version="Subtext Version 0.0.0.0">Subtext</generator>
    <updated>2013-04-30T16:29:36Z</updated>
    <entry>
        <title>Why the custom comparer is your friend</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DavidMadden/archive/2013/04/30/why-the-custom-comparer-is-your-friend.aspx" />
        <id>http://geekswithblogs.net/DavidMadden/archive/2013/04/30/why-the-custom-comparer-is-your-friend.aspx</id>
        <published>2013-04-30T16:29:36-04:00:00</published>
        <updated>2013-04-30T16:29:36Z</updated>
        <content type="html">I have a ListView that is holding session dates for sessions someone may attend.  I like to use a MonthCalendar control to allow the user to select several dates, allowing the control's DateSelected event to add an entry to the ListView control as a formatted date string for readability.  Sorting is not nice though using the plain sort orders.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So I implemented an nice solution.  I added a custom comparer to sort those string dates in the ListView control.  Just add the following to your form's namespace, in my case it was the Sessions form called "frmSessions".&lt;/div&gt;
&lt;pre&gt;    class SessionDatesListViewItemComparer : IComparer
    {
        private int col;
        public SessionDatesListViewItemComparer()
        {
            col = 0;
        }

        public int Compare(object x, object y)
        {
            int returnVal = -1;
            DateTime dateX = Convert.ToDateTime(((ListViewItem)x).SubItems[col].Text);
            DateTime dateY = Convert.ToDateTime(((ListViewItem)y).SubItems[col].Text);

            returnVal = DateTime.Compare(dateX, dateY);
            return returnVal;
        }
    }&lt;/pre&gt;&lt;div&gt;This allowed me to add a the following line in my form's Constructor (you might have more than one).&lt;/div&gt;&lt;div&gt;
&lt;pre&gt;    this.listView_SessionDates.ListViewItemSorter = new SessionDatesListViewItemComparer();
&lt;/pre&gt;
&lt;div&gt;
Now the ListView control sorts nicely each time a date is added.
&lt;/div&gt;&lt;/div&gt;&lt;img src="http://geekswithblogs.net/DavidMadden/aggbug/152827.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DavidMadden/comments/152827.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DavidMadden/comments/commentRss/152827.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DavidMadden/services/trackbacks/152827.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Casting it old school</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DavidMadden/archive/2013/04/23/casting-it-old-school.aspx" />
        <id>http://geekswithblogs.net/DavidMadden/archive/2013/04/23/casting-it-old-school.aspx</id>
        <published>2013-04-23T13:26:26-04:00:00</published>
        <updated>2013-04-23T13:26:26Z</updated>
        <content type="html">If you have to display a two numbers and a percentage from older T-SQL you can do the following.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;cast((((cast((query1) as decimal) / cast((query1) as decimal)) * 100)) as decimal(5,1)) as 'Percentage'&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;This will yield you a nice percentage like 67.9.  All the casting is to preserve the numbers as decimals and not be boxed to integers.  Note: Each query should return a count of something where query 2 is a quantity that is lesser than query1.  Such as query2 being the total who like dessert and query 1 is the total who had meals.&lt;/div&gt;&lt;img src="http://geekswithblogs.net/DavidMadden/aggbug/152769.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DavidMadden/comments/152769.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DavidMadden/comments/commentRss/152769.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DavidMadden/services/trackbacks/152769.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Crystal Reports - Getting the number under control</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DavidMadden/archive/2013/04/23/crystal-reports---getting-the-number-under-control.aspx" />
        <id>http://geekswithblogs.net/DavidMadden/archive/2013/04/23/crystal-reports---getting-the-number-under-control.aspx</id>
        <published>2013-04-23T11:19:57-04:00:00</published>
        <updated>2013-04-23T11:19:57Z</updated>
        <content type="html">I do not deal many
Crystal Reports but recently have had to dive into a few.  One of the
things that drive me nuts is dealing with numbers such as in the running
totals.  To get a number to display correctly you need to use the ToText
function.  A good site I found is &lt;a href="http://crystaltricks.com/wordpress/?p=149" title="this"&gt;this&lt;/a&gt;. &lt;br /&gt; 

&lt;br /&gt;To get the variable
myNumber = 2.3798554 to display as 2.4 you would do the following:

&lt;br /&gt; 

&lt;br /&gt;&lt;em&gt;ToText(myNumber,2)&lt;/em&gt;

&lt;br /&gt; 

&lt;br /&gt;I
know this is not very exciting stuff but if you do not deal with things like
this often, it can be a real pain.&lt;img src="http://geekswithblogs.net/DavidMadden/aggbug/152768.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DavidMadden/comments/152768.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DavidMadden/comments/commentRss/152768.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DavidMadden/services/trackbacks/152768.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Comments in code</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DavidMadden/archive/2012/11/28/comments-in-code.aspx" />
        <id>http://geekswithblogs.net/DavidMadden/archive/2012/11/28/comments-in-code.aspx</id>
        <published>2012-11-28T10:13:30-05:00:00</published>
        <updated>2012-11-28T10:13:30Z</updated>
        <content type="html">It is a good practice to leave comments in your code.  Knowing what the hell you were thinking or later intending can be salvation for yourself or the poor soul coming behind you.  Comments can leave clues to why you chose one approach over the other.  Perhaps staged re-engineering dictated that coding practices vary.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One thing that should not be left in code as comments is old code.  There are many free tools that left you version your code.  Subversion is a great tool when used with TortoiseSVN.  Leaving commented code scattered all over will cause you to second guess yourself, all distraction to the real code, and is just bad practice.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you have a versioning solution, take time to go back through your code and clean things up.  You may find that you can remove lines and leave real comments that are far more knowledgeable than having to remember why you commented out the old code in the first place.&lt;/div&gt;&lt;img src="http://geekswithblogs.net/DavidMadden/aggbug/151377.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DavidMadden/comments/151377.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DavidMadden/comments/commentRss/151377.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DavidMadden/services/trackbacks/151377.aspx</trackback:ping>
    </entry>
    <entry>
        <title>LastPass</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DavidMadden/archive/2012/11/28/lastpass.aspx" />
        <id>http://geekswithblogs.net/DavidMadden/archive/2012/11/28/lastpass.aspx</id>
        <published>2012-11-28T08:44:43-05:00:00</published>
        <updated>2012-11-28T08:44:43Z</updated>
        <content type="html">LastPass.com.  Get it, use it, save your sanity.  This is a great program to be able to remember one hard password and be able to generate several other hard passwords for each site, application, or sign in you have to use.  &lt;b&gt;Highly Recommended.&lt;/b&gt;&lt;img src="http://geekswithblogs.net/DavidMadden/aggbug/151375.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DavidMadden/comments/151375.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DavidMadden/comments/commentRss/151375.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DavidMadden/services/trackbacks/151375.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Old school trick that I forgot</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DavidMadden/archive/2012/11/28/old-school-trick-that-i-forgot-again.aspx" />
        <id>http://geekswithblogs.net/DavidMadden/archive/2012/11/28/old-school-trick-that-i-forgot-again.aspx</id>
        <published>2012-11-28T08:42:58-05:00:00</published>
        <updated>2012-11-28T08:42:58Z</updated>
        <content type="html">If you have to support some older Winforms you might like to remember this.  When opening a MessageBox to display that the user entered incorrect information, if you are doing so from a dialog, catch the DialogResult of the MessageBox and then set &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;&lt;font face="Courier New" size="2"&gt;&lt;b&gt;this.DialogResult = DialogResult.None;&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; to prevent the dialog from closing if you want the user to try again.  Otherwise, it will close the dialog box and return to the section of code that called it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note:  You do not &lt;i&gt;have to&lt;/i&gt; catch the DialogResult from the MessageBox.  You can still set this after the return from the call to the MessageBox.  Just make sure to do either but exiting the body of the dialog itself.&lt;/div&gt;&lt;img src="http://geekswithblogs.net/DavidMadden/aggbug/151373.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DavidMadden/comments/151373.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DavidMadden/comments/commentRss/151373.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DavidMadden/services/trackbacks/151373.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Scooby Doo Mystery LINQ</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DavidMadden/archive/2012/07/23/scooby-doo-mystery-linq.aspx" />
        <id>http://geekswithblogs.net/DavidMadden/archive/2012/07/23/scooby-doo-mystery-linq.aspx</id>
        <published>2012-07-23T13:51:59-04:00:00</published>
        <updated>2012-07-31T09:17:06Z</updated>
        <summary type="html">Sometimes it the old habits and not the LINQ query.  Look to the final object assignment if data is not what you though it should be and the query tested well in LINQPad.  I had failed to look into the fact the foreach loop had a coding error that was causing the data to not be part of the custom class, which output the XML from the web service.

This is akin to first checking the availability of power and then the power cord if you computer has stop working.</summary>
        <content type="html">In recent training with another staff member, we found LINQ code that worked well in LINQPad but failed in VisualStudio 2010.  Not a syntax failure but in that the query would return no value.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The programmer was new to LINQ and making strides in trying different things.  As old habits die hard, local variables where used to make an assignment to the class that would hold the information returned from the LINQ query.  In the &lt;b&gt;foreach &lt;/b&gt;block, assignment to the final object was being made to the local variables instead of the query's projection output.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The solution was to remove the local variables above the query, use &lt;b&gt;select new { ... }&lt;/b&gt; to determine the named output, and then use a &lt;b&gt;foreach&lt;/b&gt; block to output the results of the query into the final &lt;i&gt;object&lt;/i&gt; created from a custom class.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I should have caught this sooner but I had mistakenly assumed that something was not right with the query.  The query had some interesting &lt;i&gt;lambda expressions&lt;/i&gt; that I had assumed (again) that might have been causing the problem.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Lesson learned?  Check to see how assignment is made to the final object first.&lt;/div&gt;&lt;img src="http://geekswithblogs.net/DavidMadden/aggbug/150280.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DavidMadden/comments/150280.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DavidMadden/comments/commentRss/150280.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DavidMadden/services/trackbacks/150280.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Controlling access to site folders if you cannot use Roles</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DavidMadden/archive/2012/05/25/controlling-access-to-site-folders-if-you-cannot-user-roles.aspx" />
        <id>http://geekswithblogs.net/DavidMadden/archive/2012/05/25/controlling-access-to-site-folders-if-you-cannot-user-roles.aspx</id>
        <published>2012-05-25T16:08:34-04:00:00</published>
        <updated>2012-11-28T09:30:31Z</updated>
        <content type="html">&lt;p&gt;I find myself on an assignment where I could not use System.Web.Security.Roles.  That meant that I could not use Visual Studio's Website | ASP.NET Configuration.  I had to go about things another way.  The clues were in these two websites:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.csharpaspnetarticles.com/2009/02/formsauthentication-ticket-roles-aspnet.html" target="_blank"&gt;http://www.csharpaspnetarticles.com/2009/02/formsauthentication-ticket-roles-aspnet.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/b6x6shw7(v=VS.71).aspx target=" _blank?=""&gt;http://msdn.microsoft.com/en-us/library/b6x6shw7(v=VS.71).aspxhttp://msdn.microsoft.com/en-us/library/b6x6shw7(v=VS.71).aspx&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You can set in your web.config the restrictions on folders without having to set the restrictions in multiple folders through their own web.config file.  In my main default.aspx file in my protected subfolder off my main site, I did the following code due to MultiFormAuthentication (MFA) providing the security to this point:&lt;/p&gt;&lt;pre style="background: white; color: black; font-family: Consolas;"&gt;        &lt;span style="color: blue;"&gt;string&lt;/span&gt; role = &lt;span style="color: blue;"&gt;string&lt;/span&gt;.Empty;
 
&lt;/pre&gt;&lt;pre style="background: white; color: black; font-family: Consolas;"&gt;        &lt;span style="color: blue;"&gt;if&lt;/span&gt; (((&lt;span style="color: rgb(43, 145, 175);"&gt;Login&lt;/span&gt;)Session[&lt;span style="color: rgb(163, 21, 21);"&gt;"Login"&lt;/span&gt;]).UserLevelID &amp;gt; 3)
        {
            role = &lt;span style="color: rgb(163, 21, 21);"&gt;"PowerUser"&lt;/span&gt;;
        }
        &lt;span style="color: blue;"&gt;else&lt;/span&gt;
        {
            role = &lt;span style="color: rgb(163, 21, 21);"&gt;"Newbie"&lt;/span&gt;;
        }
&lt;/pre&gt;&lt;pre style="background: white; color: black; font-family: Consolas;"&gt; 
        &lt;span style="color: rgb(43, 145, 175);"&gt;FormsAuthenticationTicket&lt;/span&gt; ticket = &lt;br /&gt;            &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;FormsAuthenticationTicket&lt;/span&gt;(&lt;br /&gt;                1,
                ((&lt;span style="color: rgb(43, 145, 175);"&gt;Login&lt;/span&gt;)Session[&lt;span style="color: rgb(163, 21, 21);"&gt;"Login"&lt;/span&gt;]).UserID,
                &lt;span style="color: rgb(43, 145, 175);"&gt;DateTime&lt;/span&gt;.Now,
                &lt;span style="color: rgb(43, 145, 175);"&gt;DateTime&lt;/span&gt;.Now.AddMinutes(20),
                &lt;span style="color: blue;"&gt;false&lt;/span&gt;,
                role,
                &lt;span style="color: rgb(43, 145, 175);"&gt;FormsAuthentication&lt;/span&gt;.FormsCookiePath);
&lt;/pre&gt;&lt;pre style="background: white; color: black; font-family: Consolas;"&gt; 
        &lt;span style="color: blue;"&gt;string&lt;/span&gt; hashCookies = &lt;span style="color: rgb(43, 145, 175);"&gt;FormsAuthentication&lt;/span&gt;.Encrypt(ticket);
        &lt;span style="color: rgb(43, 145, 175);"&gt;HttpCookie&lt;/span&gt; cookie = &lt;br /&gt;            &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;HttpCookie&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;FormsAuthentication&lt;/span&gt;.FormsCookieName, hashCookies);
        Response.Cookies.Add(cookie);&lt;/pre&gt;
&lt;p&gt;This all gave me the ability to change restrictions on folders without having to restart the website or having to do any hard coding.&lt;/p&gt;&lt;img src="http://geekswithblogs.net/DavidMadden/aggbug/149736.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DavidMadden/comments/149736.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DavidMadden/comments/commentRss/149736.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DavidMadden/services/trackbacks/149736.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Pluralsight</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DavidMadden/archive/2012/05/23/pluralsight.aspx" />
        <id>http://geekswithblogs.net/DavidMadden/archive/2012/05/23/pluralsight.aspx</id>
        <published>2012-05-23T15:53:08-04:00:00</published>
        <updated>2012-05-23T15:53:08Z</updated>
        <content type="html">I would highly suggest subscribing to PluralSight if you are wanting to learn different technologies and frameworks.  I am a Visual Learner and find that it is very easy to throw on the headphones and run the app from the phone.  The videos are well designed and the screens are also well designed to be comfortable viewing on smaller screens such as the phone.&lt;img src="http://geekswithblogs.net/DavidMadden/aggbug/149716.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DavidMadden/comments/149716.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DavidMadden/comments/commentRss/149716.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DavidMadden/services/trackbacks/149716.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Using a class as a datasource for asp.net listview control</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DavidMadden/archive/2012/05/23/using-a-class-as-a-datasource-for-asp.net-listview-control.aspx" />
        <id>http://geekswithblogs.net/DavidMadden/archive/2012/05/23/using-a-class-as-a-datasource-for-asp.net-listview-control.aspx</id>
        <published>2012-05-23T09:20:11-04:00:00</published>
        <updated>2012-05-23T10:57:01Z</updated>
        <content type="html">&lt;p&gt;I found many websites that showed either misinformation, incorrect code, or denial of the ability to use a class as a datasource for an asp.net listview control.  It is actually very simple.&lt;/p&gt;&lt;p&gt;First you need to define your class.  I created private fields and public property to get and set values for those fields.  I then created a static function (since it is used often) that would return a list of the class type.&lt;/p&gt;&lt;p&gt;In my case, I was looking for documents that matched the page and page section so I can list them as hyerlinks.  After finding the correct folder and obtaining a list of the files, I populated the instantiated object and added it to the list of those objects.&lt;/p&gt;&lt;p&gt;To set and bind the datasource of the listview control I did the following:&lt;/p&gt;&lt;pre style="background: white; color: black; font-family: Consolas;"&gt;&lt;span style="color: green;"&gt;//Set datasource and bind&lt;/span&gt;
ListViewWebFiles.DataSource = &lt;span style="color: rgb(43, 145, 175);"&gt;WebFile&lt;/span&gt;.GetWebFiles(_section);
ListViewWebFiles.DataBind();&lt;/pre&gt;&lt;p&gt;My listview is in a user control to aid in dragging it to different pages.  The item template is what will be used to work with the bound datasource to create the hyperlinks to the files.&lt;/p&gt;&lt;pre style="background: white; color: black; font-family: Consolas;"&gt;&lt;span style="background: yellow;"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue;"&gt;@&lt;/span&gt; &lt;span style="color: maroon;"&gt;Control&lt;/span&gt; &lt;span style="color: red;"&gt;Language&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"C#"&lt;/span&gt; &lt;span style="color: red;"&gt;AutoEventWireup&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"true"&lt;/span&gt; &lt;span style="color: red;"&gt;CodeFile&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"WebFiles.ascx.cs"&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: red;"&gt;Inherits&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"ucWebFiles"&lt;/span&gt; &lt;span style="background: yellow;"&gt;%&amp;gt;&lt;/span&gt;
&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: maroon;"&gt;ListView&lt;/span&gt; &lt;span style="color: red;"&gt;ID&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"ListViewWebFiles"&lt;/span&gt; &lt;span style="color: red;"&gt;runat&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"server"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;ul&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;li&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;a&lt;/span&gt; &lt;span style="color: red;"&gt;href&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt;&lt;span style="background: yellow;"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue;"&gt;#&lt;/span&gt; DataBinder.Eval(Container.DataItem, "FileURL") &lt;span style="background: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;br /&gt;                   &lt;span style="color: red;"&gt;target&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"_blank"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                   &lt;span style="background: yellow;"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue;"&gt;#&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;DataBinder&lt;/span&gt;.Eval(Container.DataItem, "DisplayName") &lt;span style="background: yellow;"&gt;%&amp;gt;&lt;/span&gt;
                &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;a&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;li&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;ul&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: maroon;"&gt;ListView&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;FileURL and DisplayName are the names of the publicly exposed properties of the class.  They must match.  By the way, there is an &amp;lt;asp:Hyperlink&amp;gt; that could have been used.  It would have given the same HTML output in the end.&lt;/p&gt;&lt;p&gt;I can now put the user control on my page and supply it with the section to do the folder lookup and output the files as hyperlinks.&lt;/p&gt;&lt;pre style="background: white; color: black; font-family: Consolas;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;uc1&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: maroon;"&gt;WebDocs&lt;/span&gt; &lt;span style="color: red;"&gt;ID&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"WebFiles1"&lt;/span&gt; &lt;span style="color: red;"&gt;runat&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"server" &lt;/span&gt;&lt;span style="color: red;"&gt;Section&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"SchoolPapers"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;This control was placed on Education.aspx page and my file folder virtual path is like "~/Documents/Education/SchoolPapers".&lt;/p&gt;&lt;img src="http://geekswithblogs.net/DavidMadden/aggbug/149714.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DavidMadden/comments/149714.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DavidMadden/comments/commentRss/149714.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DavidMadden/services/trackbacks/149714.aspx</trackback:ping>
    </entry>
</feed>