<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Key2 Consulting Blogs &#187; Mason Prewett</title>
	<atom:link href="http://key2consulting.com/Blogs/author/mason-prewett/feed/" rel="self" type="application/rss+xml" />
	<link>http://key2consulting.com/Blogs</link>
	<description>BI, Data Warehousing, SharePoint and .NET</description>
	<lastBuildDate>Mon, 30 Apr 2012 17:47:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>A Simple Dynamic Site Map Page Using ASP.NET SiteMapDataSource And Nested DataLists</title>
		<link>http://key2consulting.com/Blogs/mprewett/2011/06/09/a-simple-dynamic-site-map-page-using-asp-net-sitemapdatasource-and-nested-datalists/</link>
		<comments>http://key2consulting.com/Blogs/mprewett/2011/06/09/a-simple-dynamic-site-map-page-using-asp-net-sitemapdatasource-and-nested-datalists/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 19:50:28 +0000</pubDate>
		<dc:creator>Mason Prewett</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Dynamic]]></category>
		<category><![CDATA[SiteMap]]></category>
		<category><![CDATA[SiteMap Page]]></category>

		<guid isPermaLink="false">http://2.114</guid>
		<description><![CDATA[The Description I will start by describing exactly what this blog post will accomplish. This post is concentrated on producing an aspx page that will display a site map of all links provided in the web application site map file. All parent and child nodes. Not just a menu using the sitemap as a data [...]]]></description>
			<content:encoded><![CDATA[<h3>The Description</h3>
<p>I will start by describing exactly what this blog post will accomplish. This post is concentrated on producing an aspx page that will display a site map of all links provided in the web application site map file. All parent and child nodes. Not just a menu using the sitemap as a data source, but&#160; a page that dynamically binds the contents of the sitemap to nested data lists.</p>
<p>The end result is shown below:</p>
<hr />
<p><a href="http://key2consulting.com/Blogs/mprewett/files/2011/06/SiteMapResult.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SiteMapResult" border="0" alt="SiteMapResult" src="http://key2consulting.com/Blogs/mprewett/files/2011/06/SiteMapResult_thumb.png" width="510" height="407" /></a></p>
<h3>The Code</h3>
<p><b>ASPX</b></p>
<pre class="html" name="code">

	<asp:menu id="Menu1" runat="server" datasourceid="SiteMapDataSource1" orientation="Horizontal" staticmenuitemstyle-itemspacing="20">
        </asp:menu>

        <asp:datalist id="dlParent" runat="server" onitemcreated="dlParent_ItemCreated" datasourceid="SiteMapDataSource1" cellspacing="50" repeatcolumns="3" repeatdirection="Horizontal">
            <itemstyle verticalalign="Top" />
            <itemtemplate>
                 <asp:hyperlink id="HyperLink1" runat="server" font-bold="true" font-size="13pt" forecolor="Black" navigateurl="&lt;%# DataBinder.Eval(Container.DataItem, &quot;url&quot;) %&gt;" text="&lt;%# DataBinder.Eval(Container.DataItem, &quot;title&quot;) %&gt;" />
                
                <asp:datalist id="dlChild" runat="server">
                    <itemtemplate>
                         <asp:hyperlink id="HyperLink1" runat="server" forecolor="Red" navigateurl="&lt;%# DataBinder.Eval(Container.DataItem, &quot;url&quot;) %&gt;" text="&lt;%# DataBinder.Eval(Container.DataItem, &quot;title&quot;) %&gt;" />
                        

                    </itemtemplate>
                </asp:datalist>
            </itemtemplate>
        </asp:datalist>

        <asp:sitemapdatasource id="SiteMapDataSource1" runat="server" showstartingnode="false" /></pre>
<p><b>C#</b></p>
<pre class="c-sharp" name="code">

	protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void dlParent_ItemCreated(object sender, DataListItemEventArgs e)
        {
            SiteMapProvider provider = SiteMapDataSource1.Provider;
            SiteMapNode nodeJustCreated = provider.FindSiteMapNode(provider.RootNode.ChildNodes[e.Item.ItemIndex].Url);

            if (nodeJustCreated != null &amp;&amp; nodeJustCreated.HasChildNodes)
            {
                DataList dlChildSub = (DataList)e.Item.FindControl(&quot;dlChild&quot;);
                dlChildSub.DataSource = nodeJustCreated.GetAllNodes();
                dlChildSub.DataBind();
            }
        }
</pre>
<p><b>Web.sitemap</b></p>
<pre class="xml" name="code">
	<?xml version="1.0" encoding="utf-8" ?>
	<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

    <siteMapNode url="" title=""  description="">
      <siteMapNode url="Home" title="Home"  description="Home" />
      <siteMapNode url="Products" title="Products"  description="Products">
        <siteMapNode url="Search" title="Search"  description="Search" />
        <siteMapNode url="Browse" title="Browse"  description="Browse" />
        <siteMapNode url="Order" title="Order"  description="Order" />
      </siteMapNode>
      <siteMapNode url="Services" title="Services"  description="Services">
        <siteMapNode url="Shipping" title="Shipping"  description="Shipping" />
        <siteMapNode url="Distribution" title="Distribution"  description="Distribution" />
      </siteMapNode>
      <siteMapNode url="Industries" title="Industries"  description="Industries">
        <siteMapNode url="General" title="General"  description="General" />
        <siteMapNode url="Residential" title="Residential"  description="Residential" />
        <siteMapNode url="Real Estate" title="Real Estate"  description="Real Estate" />
        <siteMapNode url="Food" title="Food"  description="Food" />
        <siteMapNode url="Cleaning" title="Cleaning"  description="Cleaning" />
        <siteMapNode url="Automotive" title="Automotive"  description="Automotive" />
        <siteMapNode url="Transportation" title="Transportation"  description="Transportation" />
        <siteMapNode url="Construction" title="Construction"  description="Construction" />
        <siteMapNode url="Corporate" title="Corporate"  description="Corporate" />
      </siteMapNode>
      <siteMapNode url="About" title="About"  description="About">
        <siteMapNode url="The Company" title="The Company"  description="The Company" />
        <siteMapNode url="The Team" title="The Team"  description="The Team" />
      </siteMapNode>
      <siteMapNode url="Contact" title="Contact"  description="Contact" />
    </siteMapNode>

</siteMap>
</pre>
<h3>&#160;</h3>
<h3>The Explanation</h3>
<p>I nest a HyperLink and DataList in the ItemTemplate of the parent DataList. I bind the parent DataList to the SieMapDataSource. </p>
<p>I then implement the ItemCreated event of the parent DataList. In this event I find the current node that was just created, then bind the child DataList to all of the child nodes underneath.</p>
<h3>Notes</h3>
<ul>
<li>My example only works for a 2-level sitemap source. This code can easily be altered to accommodate more levels using recursion or just by knowing your deepest level ahead of time. I don’t like to go further than 2 levels in the sitemap because I feel that people get confused and lost as to how they navigated to page if there is more. Just my opinion.</li>
</ul>
<p>I hope this helps. I found a few solutions on the web that did not work for me, so I dug in and figured it out on my own. Thought I would share it since it seemed like a common requirement.</p>
]]></content:encoded>
			<wfw:commentRss>http://key2consulting.com/Blogs/mprewett/2011/06/09/a-simple-dynamic-site-map-page-using-asp-net-sitemapdatasource-and-nested-datalists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AJAX.NET File Upload NULL on the first postback</title>
		<link>http://key2consulting.com/Blogs/mprewett/2011/01/17/ajax-net-file-upload-null-on-the-first-postback/</link>
		<comments>http://key2consulting.com/Blogs/mprewett/2011/01/17/ajax-net-file-upload-null-on-the-first-postback/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 18:24:16 +0000</pubDate>
		<dc:creator>Mason Prewett</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[AJAX.NET]]></category>
		<category><![CDATA[File Upload]]></category>

		<guid isPermaLink="false">http://2.102</guid>
		<description><![CDATA[So I had a FileUpload control inside of an UpdatePanel, and I set the upload button as a trigger in the update panel so that the file upload would work. However, everytime I would click the upload button on the first try the FileUpload properties were null. The second try populated everything as expected. Solution: [...]]]></description>
			<content:encoded><![CDATA[<p>
      So I had a FileUpload control inside of an UpdatePanel, and I set the upload button as a trigger in the update panel so that the file upload would work. However, everytime I would click the upload   button on the first try the FileUpload properties were null. The second try populated everything as expected.
</p>
<p>
<span style='font-weight:bold; font-size:12pt'>Solution:</span> the problem was that the event that happens before the upload button is clicked needs to be a full postback as well. In my case, I had a button that would hide and show the file upload when clicked. This button needed to cause a full postback before showing the FileUpload. I just added this button as a trigger in the update panel, so then my FileUpload was loaded on the page as a full postback. Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://key2consulting.com/Blogs/mprewett/2011/01/17/ajax-net-file-upload-null-on-the-first-postback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharepoint 2010 Membership &#8220;The method or operation is not implemented&#8221; Error</title>
		<link>http://key2consulting.com/Blogs/mprewett/2011/01/12/sharepoint-2010-membership-the-method-or-operation-is-not-implemented-error/</link>
		<comments>http://key2consulting.com/Blogs/mprewett/2011/01/12/sharepoint-2010-membership-the-method-or-operation-is-not-implemented-error/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 22:29:21 +0000</pubDate>
		<dc:creator>Mason Prewett</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Change Password]]></category>
		<category><![CDATA[FBA]]></category>
		<category><![CDATA[Forms Based Authentication]]></category>
		<category><![CDATA[Membership]]></category>
		<category><![CDATA[Membership.GetUser]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[The method or operation is not implemented]]></category>

		<guid isPermaLink="false">http://2.93</guid>
		<description><![CDATA[I wrote a custom application that served as management for FBA users in a SQL database. This application is plugged into SharePoint 2010 and manages the users that the application&#8217;s membership provider contains. Everytime I tried to make this call: Membership.GetUser(strUserName); I got this error: &#8220;The method or operation is not implemented&#8221;. Nothing about my [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a custom application that served as management for FBA users in a SQL database. This application is plugged into SharePoint 2010 and manages the users that the application&#8217;s membership provider contains. Everytime I tried to make this call:</p>
<pre name="code" class="csharp">
    Membership.GetUser(strUserName);
</pre>
<p>I got this error: <span style='font-weight:bold; font-size:14pt'>&#8220;The method or operation is not implemented&#8221;</span>.<br />
Nothing about my membership provider was custom, it was all default .Net stuff. I also found this to happen on other methods provided by the Membership object.
</p>
<p>
<span style='font-weight:bold; font-size:14pt'>Solution:</span> I was already using the method GetAllUsers() and knew that it was working fine. So I ended up using this method to find a user:</p>
<pre name="code" class="csharp">
    Membership.GetAllUsers()[strUserName];
</pre>
<p>This gets a MembershipUserCollection of all of the users and then uses the username as a key to find it in the collection. It is definently not the most efficient way to do this, but the underlying issue of the GetUser() method not working in SharePoint put me in a situation where I had to compromise functionality for efficiency.
</p>
<p>
   <span style='font-weight:bold; font-size:12pt'>Note**</span> I did see that there is stored procedure in the Membership database called &#8220;aspnet_Membership_GetUserByName&#8221;, that returns the same data as the GetUser method, you would just need to populate a MembershipUser from this. This method would definently be more efficient, it just didn&#8217;t fit my specific needs.
</p>
<p>
   <span style='font-weight:bold; font-size:12pt'>Note**</span> I also ran into similar issues using the ChangePassword asp.net control. I ended up just writing my own change password control with password textboxes and calling the Membership.ChangePassword method. I used the solution above to find my user to be updated. I began to struggle making the asp.net ChangePassword control work with Sharepoint Designer 2010 and in a custom webpart. It saved me a lot of time and effort to just write my own.
</p>
<p>
<span style='font-weight:bold; font-size:12pt'>Conclusion**</span> I have no idea why this error happens and there is nothing on the web, that I found, about it. The membership object just seems to have issues when accessed from SharePoint 2010. If anybody knows anymore on the topic please share it.</p>
]]></content:encoded>
			<wfw:commentRss>http://key2consulting.com/Blogs/mprewett/2011/01/12/sharepoint-2010-membership-the-method-or-operation-is-not-implemented-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint Active Directory Tools</title>
		<link>http://key2consulting.com/Blogs/mprewett/2010/11/17/sharepoint-active-directory-tools/</link>
		<comments>http://key2consulting.com/Blogs/mprewett/2010/11/17/sharepoint-active-directory-tools/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 16:32:29 +0000</pubDate>
		<dc:creator>Mason Prewett</dc:creator>
				<category><![CDATA[SharePoint Administration]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Change Password]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://2.75</guid>
		<description><![CDATA[I was looking for an easy way for users to be able to change their active directory password on my SharePoint 2010 portal. This tool would have taken me a lot of effort and time (which I rarely have) to create. I came across this codeplex solution Active Directory Tools For SharePoint written by Thomas [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking for an easy way for users to be able to change their active directory password on my SharePoint 2010 portal. This tool would have taken me a lot of effort and time (which I rarely have) to create.</p>
<p>I came across this codeplex solution <a href='http://adselfservice.codeplex.com/' target='_blank'>Active Directory Tools For SharePoint</a> written by Thomas Burke Holland. It was developed for MOSS, but has recently been released as beta for SharePoint 2010 as well. The beta installation was a simple exe and activate. This tool is tremendously convenient and useful on my portal and I recommend it to anyone trying to acheive the same solution.</p>
<p>I would like to add that this tool also provides the ability to allow users to update their own active directory profile from SharePoint. I have not used this feature of the tool, but it was packaged in the install and readily available if needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://key2consulting.com/Blogs/mprewett/2010/11/17/sharepoint-active-directory-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSIS Changing XML Source Data Types</title>
		<link>http://key2consulting.com/Blogs/mprewett/2010/11/09/ssis-changing-xml-source-data-types/</link>
		<comments>http://key2consulting.com/Blogs/mprewett/2010/11/09/ssis-changing-xml-source-data-types/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 18:14:30 +0000</pubDate>
		<dc:creator>Mason Prewett</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SSIS]]></category>
		<category><![CDATA[Data Types]]></category>
		<category><![CDATA[Generate XSD]]></category>
		<category><![CDATA[XML Pad]]></category>
		<category><![CDATA[XML Source]]></category>

		<guid isPermaLink="false">http://2.41</guid>
		<description><![CDATA[I was recently importing an xml file as a source and merging it to a sql query, and eventually dumping it into a SQL Server table. I was getting errors from the xml load saying that a data type was too small. I went into the advanced editor of the xml source and changed the [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently importing an xml file as a source and merging it to a sql query, and eventually dumping it into a SQL Server table.</p>
<p>I was getting errors from the xml load saying that a data type was too small. I went into the advanced editor of the xml source and changed the external and output columns to the same sufficient data type. I was still getting the same error after ensuring the integrity of the data type. Come to find out, <strong>you have to regenerate the xsd file after changing any data types of the xml source.</strong> After doing this my package ran fine.</p>
<p><strong>**Note</strong> &#8211; after you alter your xsd file or create a new one and set it as the schema file of the source, you must reset any sort keys or anything else previously configured.</p>
<p><strong>**Suggestion</strong> &#8211; I found that setting all of the xml datatypes to DT_WSTR, except for the key it generates, instead of letting the &#8220;Generate XSD&#8221; try to determine the data types, is a much more easier method. You can cast your data types afterwards. The &#8220;Generate XSD&#8221; button will set your data types based on the first value it encounters. So for example, it may see a value of 5 and set the data type for that column to a single byte integer which may be too small for other values it encounters. I ended up using <a href="http://www.wmhelp.com/xmlpad3.htm">XML Pad</a> to generate my xsd file. It will generate an xsd file with all data types as strings. Worked well for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://key2consulting.com/Blogs/mprewett/2010/11/09/ssis-changing-xml-source-data-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Always Show Pager/Status Bar In A RadGrid</title>
		<link>http://key2consulting.com/Blogs/mprewett/2010/09/03/always-show-pagerstatus-bar-in-a-radgrid/</link>
		<comments>http://key2consulting.com/Blogs/mprewett/2010/09/03/always-show-pagerstatus-bar-in-a-radgrid/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 19:10:52 +0000</pubDate>
		<dc:creator>Mason Prewett</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[RadGrid]]></category>
		<category><![CDATA[Telerik]]></category>

		<guid isPermaLink="false">http://2.24</guid>
		<description><![CDATA[I had a radgrid on my asp.net page that I was trying to have always show the Status Bar/Pager, even when there was not enough items to go past 1 page. Surprisingly there was not a lot on the web about this issue. After some digging I found this property that did exactly this. Simply [...]]]></description>
			<content:encoded><![CDATA[<p>I had a radgrid on my asp.net page that I was trying to have always show the Status Bar/Pager, even when there was not enough items to go past 1 page. Surprisingly there was not a lot on the web about this issue. After some digging I found this property that did exactly this.</p>
<p>Simply add this under the RadGrid tag.</p>
<pre name="code" class="xml">
    <PagerStyle AlwaysVisible="true" />
</pre>
]]></content:encoded>
			<wfw:commentRss>http://key2consulting.com/Blogs/mprewett/2010/09/03/always-show-pagerstatus-bar-in-a-radgrid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Telerik RadControls Give &#8220;Error Rendering Control&#8221; Message In Design View Of Visual Studio</title>
		<link>http://key2consulting.com/Blogs/mprewett/2010/08/18/telerik-radcontrols-give-error-rendering-control-message-in-design-view/</link>
		<comments>http://key2consulting.com/Blogs/mprewett/2010/08/18/telerik-radcontrols-give-error-rendering-control-message-in-design-view/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 19:15:25 +0000</pubDate>
		<dc:creator>Mason Prewett</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[RadControl]]></category>
		<category><![CDATA[Telerik]]></category>

		<guid isPermaLink="false">http://2.17</guid>
		<description><![CDATA[While using Telerik RadControls, I kept getting an error in design view of visual studio that read &#8220;Error rendering control&#8221;. This happened after I dragged a RadSkinManager and a RadAjaxPanel on the page. After much searching the web, I eventually ran across this blog entry written by a Telerik blog administrator. It is a known [...]]]></description>
			<content:encoded><![CDATA[<p>While using Telerik RadControls, I kept getting an error in design view of visual studio that read &#8220;Error rendering control&#8221;. This happened after I dragged a RadSkinManager and a RadAjaxPanel on the page. After much searching the web, I eventually ran across <a href="http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/error-rendering-control-unable-to-cast-object-of-typea-to-typea.aspx" target="_blank">this blog entry</a> written by a Telerik blog administrator. It is a known bug apparently and the fix described on this page did work perfectly for me. It offers fixes for 32 and 64 bit which was good for me because I was developing on a 64 bit environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://key2consulting.com/Blogs/mprewett/2010/08/18/telerik-radcontrols-give-error-rendering-control-message-in-design-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

