<rss version="2.0" 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:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title> The Trials and Tribulations of a Self-Taught Developer</title>
        <link>http://geekswithblogs.net/jrussell/Default.aspx</link>
        <description>By Justin Russell</description>
        <language>en-US</language>
        <copyright>Justin Russell</copyright>
        <managingEditor>jrussell@crystaltech.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title> The Trials and Tribulations of a Self-Taught Developer</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/jrussell/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>SPGridView for FBA with Context Menu's, Paging, Sorting, and Searching</title>
            <link>http://geekswithblogs.net/jrussell/archive/2008/07/29/spgridview-for-fba-with-context-menus-paging-sorting-and-searching.aspx</link>
            <description>&lt;p&gt;OK, here is a nice chunk of code for a web part that will display the accounts within a Forms Based Authentication database. The code is complete all the bells and whistles including a context menu, paging, sorting, and searching. I couldn't get filtering to work so I opted for searching instead. It turns out searching will be a much more beneficial feature because selecting a username to filter on from a list of several hundred items would be pretty inefficient. This code should pretty much plug into a web part. I'm posting it here for reference - if someone needs clarification, post your question in the comments.&lt;/p&gt;  &lt;p&gt;I apologize in advance for the line wrapping caused by the lack of width available in my blog. If you can't get a good copy and paste let me know and I'll put it somewhere as a text file.&lt;/p&gt;  &lt;p&gt;using System;    &lt;br /&gt;using System.Runtime.InteropServices;     &lt;br /&gt;using System.Web.UI;     &lt;br /&gt;using System.Web.UI.WebControls;     &lt;br /&gt;using System.Web.UI.WebControls.WebParts;     &lt;br /&gt;using System.Xml.Serialization;     &lt;br /&gt;using System.Data;     &lt;br /&gt;using Microsoft.SharePoint;     &lt;br /&gt;using Microsoft.SharePoint.WebControls;     &lt;br /&gt;using Microsoft.SharePoint.WebPartPages;     &lt;br /&gt;using System.Web.Security; &lt;/p&gt;  &lt;p&gt;namespace FBAUserManagement    &lt;br /&gt;{     &lt;br /&gt;    [Guid("55125528-2879-4a94-b2b2-aa45d807f54d")]     &lt;br /&gt;    public class FBAUserManagement : System.Web.UI.WebControls.WebParts.WebPart     &lt;br /&gt;    {     &lt;br /&gt;        DataSet oDataSet = new DataSet();     &lt;br /&gt;        DataTable dt = new DataTable();     &lt;br /&gt;        DataView oView = new DataView();     &lt;br /&gt;        SPGridView oGrid = new SPGridView();     &lt;br /&gt;        Table searchTable = new Table();     &lt;br /&gt;        TextBox txtUserSearch = new TextBox();     &lt;br /&gt;        Button btnSearch = new Button(); &lt;/p&gt;  &lt;p&gt;        public FBAUserManagement()    &lt;br /&gt;        { &lt;/p&gt;  &lt;p&gt;        } &lt;/p&gt;  &lt;p&gt;        protected override void CreateChildControls()    &lt;br /&gt;        {     &lt;br /&gt;            try     &lt;br /&gt;            {     &lt;br /&gt;                //Set up the search table appearing above the SPGridView     &lt;br /&gt;                searchTable.ID = "navTable";     &lt;br /&gt;                txtUserSearch.ID = "txtUserSearch";     &lt;br /&gt;                btnSearch.ID = "btnSearch";     &lt;br /&gt;                btnSearch.Text = "Search)";     &lt;br /&gt;                TableRow tr1 = new TableRow();     &lt;br /&gt;                searchTable.Rows.Add(tr1);     &lt;br /&gt;                TableCell tc1 = new TableCell();     &lt;br /&gt;                tc1.Text = "Search (e-mail):";     &lt;br /&gt;                TableCell tc2 = new TableCell();     &lt;br /&gt;                tc2.Controls.Add(txtUserSearch);     &lt;br /&gt;                TableCell tc3 = new TableCell();     &lt;br /&gt;                tc3.Controls.Add(btnSearch);     &lt;br /&gt;                tr1.Cells.Add(tc1);     &lt;br /&gt;                tr1.Cells.Add(tc2);     &lt;br /&gt;                tr1.Cells.Add(tc3);     &lt;br /&gt;                this.Controls.Add(searchTable); &lt;/p&gt;  &lt;p&gt;                PopulateDataset();    &lt;br /&gt;                oView.Table = dt;     &lt;br /&gt;                oGrid.ID = "UserGrid";     &lt;br /&gt;                oGrid.DataSource = oView;     &lt;br /&gt;                oGrid.AutoGenerateColumns = false;     &lt;br /&gt;                oGrid.AllowSorting = true;     &lt;br /&gt;                oGrid.Sorting += new GridViewSortEventHandler(oGrid_Sorting); &lt;/p&gt;  &lt;p&gt;                //Add the UserName column to the DataView    &lt;br /&gt;                SPMenuField colMenu = new SPMenuField();     &lt;br /&gt;                colMenu.HeaderText = "User Name";     &lt;br /&gt;                colMenu.TextFields = "UserName";     &lt;br /&gt;                colMenu.MenuTemplateId = "UserNameListMenu";     &lt;br /&gt;                colMenu.NavigateUrlFields = "UserName";     &lt;br /&gt;                colMenu.NavigateUrlFormat = "do.aspx?p={0}";     &lt;br /&gt;                colMenu.TokenNameAndValueFields = "NAME=UserName";     &lt;br /&gt;                colMenu.SortExpression = "UserName"; &lt;/p&gt;  &lt;p&gt;                //Build the Contenx Menu    &lt;br /&gt;                //Images used are all native to SharePoint     &lt;br /&gt;                MenuTemplate UserNameListMenu = new MenuTemplate();     &lt;br /&gt;                UserNameListMenu.ID = "UserNameListMenu"; &lt;/p&gt;  &lt;p&gt;                MenuItemTemplate userDisable = new MenuItemTemplate("Disable Account", "/_layouts/images/ServiceNotInstalled.gif");    &lt;br /&gt;                userDisable.ID = "userDisable";     &lt;br /&gt;                userDisable.ClientOnClickNavigateUrl = "do.aspx?this=%EDIT%that=%NAME%";     &lt;br /&gt;                UserNameListMenu.Controls.Add(userDisable); &lt;/p&gt;  &lt;p&gt;                MenuItemTemplate userUnlock = new MenuItemTemplate("Unlock Account", "/_layouts/images/ServiceInstalled.gif");    &lt;br /&gt;                userUnlock.ID = "userUnlock";     &lt;br /&gt;                userUnlock.ClientOnClickNavigateUrl = "do.aspx?this=%EDIT%that=%NAME%";     &lt;br /&gt;                UserNameListMenu.Controls.Add(userUnlock); &lt;/p&gt;  &lt;p&gt;                MenuItemTemplate userReset = new MenuItemTemplate("Reset Password", "/_layouts/images/recurrence.gif");    &lt;br /&gt;                userReset.ID = "userReset";     &lt;br /&gt;                userReset.ClientOnClickNavigateUrl = "do.aspx?this=%EDIT%that=%NAME%";     &lt;br /&gt;                UserNameListMenu.Controls.Add(userReset); &lt;/p&gt;  &lt;p&gt;                this.Controls.Add(UserNameListMenu);    &lt;br /&gt;                oGrid.Columns.Add(colMenu); &lt;/p&gt;  &lt;p&gt;                //Add E-mail Column    &lt;br /&gt;                BoundField emailLink = new BoundField();     &lt;br /&gt;                emailLink.DataField = "Email";     &lt;br /&gt;                emailLink.HeaderText = "E-mail";     &lt;br /&gt;                emailLink.SortExpression = "Email";     &lt;br /&gt;                oGrid.Columns.Add(emailLink); &lt;/p&gt;  &lt;p&gt;                //Add Locked Out Column    &lt;br /&gt;                CheckBoxField isLockedOut = new CheckBoxField();     &lt;br /&gt;                isLockedOut.DataField = "IsLockedOut";     &lt;br /&gt;                isLockedOut.HeaderText = "Locked Out";     &lt;br /&gt;                isLockedOut.SortExpression = "IsLockedOut";     &lt;br /&gt;                oGrid.Columns.Add(isLockedOut); &lt;/p&gt;  &lt;p&gt;                //Add Last Login Column    &lt;br /&gt;                BoundField LastLogin = new BoundField();     &lt;br /&gt;                LastLogin.DataField = "LastLoginDate";     &lt;br /&gt;                LastLogin.HeaderText = "Last Login";     &lt;br /&gt;                LastLogin.SortExpression = "LastLoginDate";     &lt;br /&gt;                oGrid.Columns.Add(LastLogin); &lt;/p&gt;  &lt;p&gt;                //Add Last Password Change Column    &lt;br /&gt;                BoundField LastPasswordChange = new BoundField();     &lt;br /&gt;                LastPasswordChange.DataField = "LastPasswordChangedDate";     &lt;br /&gt;                LastPasswordChange.HeaderText = "Last Password Change";     &lt;br /&gt;                LastPasswordChange.SortExpression = "LastPasswordChangedDate";     &lt;br /&gt;                oGrid.Columns.Add(LastPasswordChange); &lt;/p&gt;  &lt;p&gt;                this.Controls.Add(oGrid); &lt;/p&gt;  &lt;p&gt;                //Turn on Paging and add event handler    &lt;br /&gt;                oGrid.PageSize = 10;     &lt;br /&gt;                oGrid.AllowPaging = true;     &lt;br /&gt;                oGrid.PageIndexChanging += new GridViewPageEventHandler(oGrid_PageIndexChanging);     &lt;br /&gt;                oGrid.PagerTemplate = null; // Must be called after Controls.Add(oGrid) &lt;/p&gt;  &lt;p&gt;                //Recreate current sort if needed    &lt;br /&gt;                if (ViewState["SortDirection"] != null &amp;amp;&amp;amp; ViewState["SortExpression"] != null)     &lt;br /&gt;                {     &lt;br /&gt;                    //We have sorting so it needs to be preserved     &lt;br /&gt;                    oView.Sort = ViewState["SortExpression"].ToString() + " " + ViewState["SortDirection"].ToString();     &lt;br /&gt;                } &lt;/p&gt;  &lt;p&gt;                base.CreateChildControls();    &lt;br /&gt;            }     &lt;br /&gt;            catch (Exception e)     &lt;br /&gt;            {     &lt;br /&gt;                Page.Response.Write(e.ToString());     &lt;br /&gt;            }     &lt;br /&gt;        } &lt;/p&gt;  &lt;p&gt;        void oGrid_PageIndexChanging(object sender, GridViewPageEventArgs e)    &lt;br /&gt;        {     &lt;br /&gt;            oGrid.PageIndex = e.NewPageIndex;     &lt;br /&gt;            oGrid.DataBind();     &lt;br /&gt;        } &lt;/p&gt;  &lt;p&gt;        private void ApplyFilter()    &lt;br /&gt;        {     &lt;br /&gt;            if (txtUserSearch.Text != "")     &lt;br /&gt;            {     &lt;br /&gt;                oView.RowFilter = string.Format("Email LIKE '%{0}%'", txtUserSearch.Text);     &lt;br /&gt;            }     &lt;br /&gt;        } &lt;/p&gt;  &lt;p&gt;        protected override void Render(HtmlTextWriter writer)    &lt;br /&gt;        {     &lt;br /&gt;            //If there is a filter it must be applied before binding     &lt;br /&gt;            ApplyFilter();     &lt;br /&gt;            oGrid.DataBind();     &lt;br /&gt;            base.Render(writer);     &lt;br /&gt;        } &lt;/p&gt;  &lt;p&gt;        private void oGrid_Sorting(object sender, GridViewSortEventArgs e)    &lt;br /&gt;        {     &lt;br /&gt;            //Sorting Logic     &lt;br /&gt;            string lastExpression = "";     &lt;br /&gt;            if (ViewState["SortExpression"] != null)     &lt;br /&gt;                lastExpression = ViewState["SortExpression"].ToString(); &lt;/p&gt;  &lt;p&gt;            string lastDirection = "asc";    &lt;br /&gt;            if (ViewState["SortDirection"] != null)     &lt;br /&gt;                lastDirection = ViewState["SortDirection"].ToString(); &lt;/p&gt;  &lt;p&gt;            string newDirection = "asc";    &lt;br /&gt;            if (e.SortExpression == lastExpression)     &lt;br /&gt;                newDirection = (lastDirection == "asc") ? "desc" : "asc"; &lt;/p&gt;  &lt;p&gt;            ViewState["SortExpression"] = e.SortExpression;    &lt;br /&gt;            ViewState["SortDirection"] = newDirection; &lt;/p&gt;  &lt;p&gt;            oView.Sort = e.SortExpression + " " + newDirection;    &lt;br /&gt;            oGrid.DataBind(); &lt;/p&gt;  &lt;p&gt;        } &lt;/p&gt;  &lt;p&gt;        private void PopulateDataset()    &lt;br /&gt;        {     &lt;br /&gt;            //Pull each user in the membership into a DataSet     &lt;br /&gt;            oDataSet.ExtendedProperties.Add("ID", "MyDataSet");     &lt;br /&gt;            dt = oDataSet.Tables.Add("Users");     &lt;br /&gt;            MembershipUserCollection muc;     &lt;br /&gt;            muc = Membership.GetAllUsers();     &lt;br /&gt;            int counter = 0;     &lt;br /&gt;            dt.Columns.Add("ID", Type.GetType("System.Int32"));     &lt;br /&gt;            dt.Columns.Add("UserName", Type.GetType("System.String"));     &lt;br /&gt;            dt.Columns.Add("Email", Type.GetType("System.String"));     &lt;br /&gt;            dt.Columns.Add("isLockedOut", Type.GetType("System.Boolean"));     &lt;br /&gt;            dt.Columns.Add("LastLoginDate", Type.GetType("System.DateTime"));     &lt;br /&gt;            dt.Columns.Add("LastPasswordChangedDate", Type.GetType("System.DateTime"));     &lt;br /&gt;            foreach (MembershipUser mu in muc)     &lt;br /&gt;            {     &lt;br /&gt;                DataRow dr;     &lt;br /&gt;                dr = dt.NewRow();     &lt;br /&gt;                dr["ID"] = counter;     &lt;br /&gt;                dr["UserName"] = mu.UserName;     &lt;br /&gt;                dr["Email"] = mu.Email;     &lt;br /&gt;                dr["isLockedOut"] = mu.IsLockedOut;     &lt;br /&gt;                dr["LastLoginDate"] = mu.LastLoginDate;     &lt;br /&gt;                dr["LastPasswordChangedDate"] = mu.LastPasswordChangedDate;     &lt;br /&gt;                dt.Rows.Add(dr);     &lt;br /&gt;                counter++;     &lt;br /&gt;            } &lt;/p&gt;  &lt;p&gt;        }    &lt;br /&gt;    }     &lt;br /&gt;}&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124109"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124109" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/jrussell/aggbug/124109.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Justin Russell</dc:creator>
            <guid>http://geekswithblogs.net/jrussell/archive/2008/07/29/spgridview-for-fba-with-context-menus-paging-sorting-and-searching.aspx</guid>
            <pubDate>Wed, 30 Jul 2008 00:04:26 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/jrussell/comments/124109.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/jrussell/archive/2008/07/29/spgridview-for-fba-with-context-menus-paging-sorting-and-searching.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/jrussell/comments/commentRss/124109.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/jrussell/services/trackbacks/124109.aspx</trackback:ping>
        </item>
        <item>
            <title>SPListItemVersion.Created</title>
            <link>http://geekswithblogs.net/jrussell/archive/2008/07/22/splistitemversion.created.aspx</link>
            <description>&lt;p&gt;Here is an annoying inconsistency within the SharePoint Object Model. In list items, you can easily retrieve the Created Date and Modified Date through the OM. It's also pretty easy to get the created date and time for different versions of a list item. What threw me off was that the Created Date and Modified Date of the current item are stored in the time zone set in the SharePoint Administration Web Site (ex: GMT -7) however; the date and times for previous versions are stored in GMT. I was stuck on this probably for longer than I should have been but it's still a maddening irregularity. Anyway; here is how I dealt with the problem...&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;foreach (SPListItemVersion currentVersion in listItem.Versions)   &lt;br /&gt;{    &lt;br /&gt;        versionDateString = currentVersion.Created.ToString();    &lt;br /&gt;        versionDate = DateTime.Parse(versionDateString);    &lt;br /&gt;        versionDate = versionDate.AddHours(-7);    &lt;br /&gt;} &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123957"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123957" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/jrussell/aggbug/123957.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Justin Russell</dc:creator>
            <guid>http://geekswithblogs.net/jrussell/archive/2008/07/22/splistitemversion.created.aspx</guid>
            <pubDate>Tue, 22 Jul 2008 23:45:06 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/jrussell/comments/123957.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/jrussell/archive/2008/07/22/splistitemversion.created.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/jrussell/comments/commentRss/123957.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/jrussell/services/trackbacks/123957.aspx</trackback:ping>
        </item>
        <item>
            <title>JavaScript: Hide Or Show Image With Blink</title>
            <link>http://geekswithblogs.net/jrussell/archive/2008/06/20/javascript-hide-or-show-image-with-blink.aspx</link>
            <description>&lt;p style="font-family: Verdana;"&gt;Now that I have the solution, it was pretty simple. Here is an example of how to blick an image using Javascript. The image will either be hidden or displayed becase upon the value passed to the function.&lt;/p&gt;
&lt;p style="font-family: Verdana;"&gt;I'm posting this for reference because I couldn't find any examples of how to blink an image and then leave it either hidden or visible after blinking.&lt;/p&gt;
&lt;p style="font-family: Verdana;"&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;Blinking Image&amp;lt;/title&amp;gt;&lt;/p&gt;
&lt;p style="font-family: Verdana;"&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;
function toggle_visibility(hideorshow)&lt;br /&gt;
{&lt;br /&gt;
    var e = document.getElementById("alerticon");&lt;br /&gt;
    if (hideorshow == 'hide')&lt;br /&gt;
    {&lt;br /&gt;
        if (e.style.visibility == 'visible')&lt;br /&gt;
        {&lt;br /&gt;
            blink(6);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            blink(7);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (e.style.visibility == 'visible')&lt;br /&gt;
        {&lt;br /&gt;
            blink(7);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            blink(6);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
function blink(count)&lt;br /&gt;
{&lt;br /&gt;
    var count = count&lt;br /&gt;
    var e = document.getElementById("alerticon");&lt;br /&gt;
    e.style.visibility = ( e.style.visibility == 'visible' )? 'hidden' : 'visible';&lt;br /&gt;
    count--;&lt;br /&gt;
    if (count &amp;lt;= 0)&lt;br /&gt;
    {&lt;br /&gt;
    return;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        setTimeout("blink('" + count + "');", 500);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p style="font-family: Verdana;"&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
        &amp;lt;img id="alerticon" alt="alert" src="exclamation_red_16x16.gif" style="visibility:hidden" /&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;a href="#" onclick="toggle_visibility('hide')"&amp;gt;SHOW&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;a href="#" onclick="toggle_visibility('show')"&amp;gt;HIDE&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;/p&gt;
&lt;p style="font-family: Verdana;"&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123048"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123048" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/jrussell/aggbug/123048.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Justin Russell</dc:creator>
            <guid>http://geekswithblogs.net/jrussell/archive/2008/06/20/javascript-hide-or-show-image-with-blink.aspx</guid>
            <pubDate>Fri, 20 Jun 2008 21:14:59 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/jrussell/comments/123048.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/jrussell/archive/2008/06/20/javascript-hide-or-show-image-with-blink.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/jrussell/comments/commentRss/123048.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/jrussell/services/trackbacks/123048.aspx</trackback:ping>
        </item>
        <item>
            <title>iCalendar Time Zone</title>
            <link>http://geekswithblogs.net/jrussell/archive/2008/01/24/wss_calendar_workflow.aspx</link>
            <description>&lt;p style="margin-bottom: 12pt; font-family: Verdana;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;I recently began development of a new SharePoint (WSS) workflow. The idea is pretty straightforward. When an item is added to the calendar, the workflow will send out a reminder e-mail 24 hours prior to the Start Time. The e-mail will include the details of the appointment and an iCalender (.ics) attachment so people can add the appointment to their e-mail client calendar. &lt;br /&gt;
&lt;br /&gt;
&lt;span style=""&gt;&lt;/span&gt;Seems pretty simple, right? Well, there are a few pitfalls I've encountered along the way that I'd like to share for others in a similar situation.&lt;br /&gt;
&lt;br /&gt;
First - the SharePoint SendEmail action does not allow for attachments, so you're gonna have to use the .NET method for sending mail. There are already lots of great posts out there on sending e-mail with attachments from a SharePoint workflow so I'm not going to cover it again. The challenge I ran into was adding the recipients e-mail addresses. I found some examples of this too but none of them worked for me. I ended up mashing together some different techniques and this is what I came up with:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;             MailMessage mailMessage = new MailMessage();&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;             mailMessage.From = new MailAddress(smtpFrom);&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;             mailMessage.Subject = "Message Subject";&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;             mailMessage.IsBodyHtml = true;&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;             mailMessage.Body = strBody;&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;             SPSite oSiteCollection = new SPSite("Http://127.0.0.1");&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;             SPWeb currentWeb = oSiteCollection.OpenWeb();&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;             using (SPWeb oWebsite = oSiteCollection.AllWebs["ChangeMan"])&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;             {&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;                 foreach (SPUser oUser in oWebsite.AllUsers)&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;                 {&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;                     if (oUser.Email.ToString().Length &amp;gt; 1)&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;                     {&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;                         mailMessage.To.Add(new MailAddress(oUser.Email.ToString()));&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;                     }&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;                 }&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;span style="font-style: italic;"&gt;             }&lt;/span&gt;&lt;br style="font-style: italic;" /&gt;
&lt;br style="font-style: italic;" /&gt;
I apologize for the lack of comments and links to the resources I used. If portions of the code look familiar please let me know and I'll be happy to give you credit.&lt;br /&gt;
&lt;br /&gt;
The second problem I encountered was with the iCal attachment. The time zone would always be wrong in my Outlook, even though when opening the attachment in Notepad the times were correct. I toyed with a bunch of different methods to create the attachment then I finally stumbled upon this little gem:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://tiny.cc/H1eOP" target="_blank"&gt; http://tiny.cc/H1eOP&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Specifically, this section:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-family: Verdana;" class="MsoNormal"&gt;&lt;em&gt;&lt;span style="font-size: 12pt;"&gt;The difference between a floating time and an UTC time is one letter. This is an UTC time &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="font-family: Verdana;" class="MsoNormal"&gt;&lt;em&gt;&lt;span style="font-size: 12pt; color: rgb(163, 21, 21);"&gt;"DTSTART:{0:yyyyMMdd}T{1:hhmmss}Z"&lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="font-size: 12pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="font-family: Verdana;" class="MsoNormal"&gt;&lt;em&gt;&lt;span style="font-size: 12pt;"&gt;And this a floating time &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="font-family: Verdana;" class="MsoNormal"&gt;&lt;em&gt;&lt;span style="font-size: 12pt; color: rgb(163, 21, 21);"&gt;"DTSTART:{0:yyyyMMdd}T{1:hhmmss}"&lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="font-size: 12pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="font-family: Verdana;" class="MsoNormal"&gt;&lt;em&gt;&lt;span style="font-size: 12pt;"&gt;The UTC time has an extra Z. &lt;/span&gt;&lt;/em&gt;&lt;span style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="font-family: Verdana;"&gt;&lt;span style="font-size: 12pt;"&gt;I haven't seen this information anywhere else (no, I didn't read the entire RFC) so I want to give thanks to the author.&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118863"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118863" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/jrussell/aggbug/118863.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Justin Russell</dc:creator>
            <guid>http://geekswithblogs.net/jrussell/archive/2008/01/24/wss_calendar_workflow.aspx</guid>
            <pubDate>Thu, 24 Jan 2008 10:32:34 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/jrussell/comments/118863.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/jrussell/archive/2008/01/24/wss_calendar_workflow.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/jrussell/comments/commentRss/118863.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/jrussell/services/trackbacks/118863.aspx</trackback:ping>
        </item>
    </channel>
</rss>