<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Nathan Yorke</title><link>http://weblogs.asp.net/nathanyorke/default.aspx</link><description>Getting things done one line of code at a time.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>LINQ using stored procedures without implicitly typed variables</title><link>http://weblogs.asp.net/nathanyorke/archive/2008/01/30/linq-using-stored-procedures-without-implicitly-typed-variables.aspx</link><pubDate>Wed, 30 Jan 2008 21:38:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5678078</guid><dc:creator>Yorkenw06</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/nathanyorke/rsscomments.aspx?PostID=5678078</wfw:commentRss><comments>http://weblogs.asp.net/nathanyorke/archive/2008/01/30/linq-using-stored-procedures-without-implicitly-typed-variables.aspx#comments</comments><description>&lt;h2&gt;&lt;b&gt;Problem:&lt;/b&gt;&amp;nbsp;&lt;/h2&gt;  &lt;p&gt;You want (need to because of the
stubborn dba!) to use stored procedures in your next project and would
also like to take advantage of the new features in .Net 3.5 like LINQ
and extension methods, implicitly typed variables etc.&amp;nbsp; I particularly
don't like to use the implicitly typed variables (the new &lt;b&gt;var &lt;/b&gt;keyword).&amp;nbsp;
I like strong typed variables better since it makes the code easier to
read.&amp;nbsp; Don't let the name fool you Implicitly Typed Variables in C# 3.5
are still strongly typed because you can't change the type of the
variable once it has been initialized.&lt;/p&gt;  &lt;p&gt;LINQ makes it super easy
to work with stored procedures with dragging and dropping the procedure
into the data context designer (I am not going to get into the details
here, so if you do not know click &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/08/16/linq-to-sql-part-6-retrieving-data-using-stored-procedures.aspx" mce_href="http://weblogs.asp.net/scottgu/archive/2007/08/16/linq-to-sql-part-6-retrieving-data-using-stored-procedures.aspx"&gt;here&lt;/a&gt;).&amp;nbsp;
It will automatically generate a method for you with parameters and
everything.&amp;nbsp; The issue is if you are joining two or more tables
together inside your procedure LINQ does not understand this and it
therefore will not return a hierarchal data object (like ad hoc LINQ
calls do).&amp;nbsp; It is not even an object that consists of the types that
are inside your data context representing your tables.&amp;nbsp; Instead it
returns an object of type ISingeResult.&amp;nbsp; This is where the &lt;b&gt;var &lt;/b&gt;keyword
comes in as you normally would just use this and move on.&amp;nbsp; I find this
difficult (the ISingeResult) when I am creating my data access layer as
I would like to know what type of object to expect to get back before I
invoke the method.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/nathanyorke/WindowsLiveWriter/LINQusingstoredprocedureswithoutimplicit_EEB6/Untitled1_6.jpg" mce_href="http://weblogs.asp.net/blogs/nathanyorke/WindowsLiveWriter/LINQusingstoredprocedureswithoutimplicit_EEB6/Untitled1_6.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/nathanyorke/WindowsLiveWriter/LINQusingstoredprocedureswithoutimplicit_EEB6/Untitled1_thumb_2.jpg" style="border-width: 0px;" alt="Untitled1" mce_src="http://weblogs.asp.net/blogs/nathanyorke/WindowsLiveWriter/LINQusingstoredprocedureswithoutimplicit_EEB6/Untitled1_thumb_2.jpg" border="0" height="484" width="642"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h2&gt;Solution: &lt;/h2&gt;  &lt;p&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;When
calling LINQ stored procedures from your data context object you can
build and return an object whose type already exists in the data
context, like Topic, Reply, Subject or User in the above.&amp;nbsp; This way you
can return familiar types that have meaning and are easy to read.&amp;nbsp;&amp;nbsp; &lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; Topic Get(&lt;span class="kwrd"&gt;int&lt;/span&gt; TopicId)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;            Topic Topic =&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;            (&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;                from T &lt;span class="kwrd"&gt;in&lt;/span&gt; _DB.GetTopicById(TopicId) &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;                select &lt;span class="kwrd"&gt;new&lt;/span&gt; Topic &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;                { &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;                    TopicId = TopicId, &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;                    TeamId = T.TeamId, &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;                    UserId = T.UserId, &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;                    User = &lt;span class="kwrd"&gt;new&lt;/span&gt; User &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;                    { &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;                        UserId = T.UserId, &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;                        UserName = T.UserName &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;                    }, &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;                    SubjectId = T.SubjectId, &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;                    Subject = &lt;span class="kwrd"&gt;new&lt;/span&gt; Subject &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;                    { &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;                        SubjectId = T.SubjectId, &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;                        Subject1 = T.Subject &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;                    }, &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;                    Description = T.Description, &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;                    Topic1 = T.Topic, &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;                    Folder = T.Folder, &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;                    Link = T.Link, &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;                    GameDateTime = T.GameDateTime, &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;                    CreatedDateTime = T.CreatedDateTime, &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;                    PromotedDateTime = T.PromotedDateTime, &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;                    Total = 1, &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;                    TotalReplies = T.TotalReplies.Value &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;                }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;            ).FirstOrDefault();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (Topic != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;            {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;                Topic.Replies.AddRange(GetReplies(Topic.TopicId));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;            }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; Topic;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;        }&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;div class="csharpcode"&gt;&amp;nbsp;&lt;/div&gt;

&lt;p&gt;This method is returning an single Topic object.&amp;nbsp; It is also joining
in a User object and Subject object both of which are child tables to
Topic in the database.&amp;nbsp; The results from the stored procedure is one
row of data from multiple tables, but the code is building a hierarchal
object.&amp;nbsp; The "select" statement in the above code (lines 6-31) is
rebuilding the types of objects that currently exists in our data
context instead of returning an object of type ISingleResult.&amp;nbsp; This
provides more of a user friendly approach to our data layer.&amp;nbsp; The last
part of this method (line 35) is getting all of the Replies for a
Topic.&amp;nbsp; This is a separate step, but this way we can return one
hierarchal Topic object to the caller with out the need to enumerate
via a foreach statement over the data.&lt;/p&gt;

&lt;div class="csharpcode"&gt;&amp;nbsp;&lt;/div&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; List&amp;lt;Reply&amp;gt; GetReplies(&lt;span class="kwrd"&gt;int&lt;/span&gt; TopicId)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;            (&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;                from R &lt;span class="kwrd"&gt;in&lt;/span&gt; _DB.GetRepliesByTopicId(TopicId)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;                select &lt;span class="kwrd"&gt;new&lt;/span&gt; Reply&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;                {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;                    ReplyId = R.ReplyId,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;                    UserId = R.UserId,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;                    User = &lt;span class="kwrd"&gt;new&lt;/span&gt; User&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;                    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;                        UserId = R.UserId,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;                        UserName = R.UserName&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;                    },&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;                    ParentReplyId = R.ParentReplyId,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;                    Reply1 = R.Reply,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;                    CreatedDateTime = R.CreatedDateTime,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;                    TotalUps = R.TotalUps&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;                }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;            ).ToList&amp;lt;Reply&amp;gt;();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        }&lt;/pre&gt;
&lt;/div&gt;

&lt;div class="csharpcode"&gt;&amp;nbsp;&lt;/div&gt;

&lt;p&gt;This method does the same thing as the example above.&amp;nbsp; It is running
a query that selects 1 to n Reply records from the database.&amp;nbsp; It then
casts the results in to a generic list of type Reply (this class exists
in our data context) instead of a ISingleResult which gets added to the
topic object above in line 35.&lt;/p&gt;

&lt;p&gt;This exposes some of the power behind .Net 3.5 and LINQ, although,
most people will not have a need for this solution, but I worked nicely
for me.&amp;nbsp; &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5678078" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/nathanyorke/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/nathanyorke/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://weblogs.asp.net/nathanyorke/archive/tags/SQL+Server/default.aspx">SQL Server</category></item><item><title>InfoPath form deployed to Sharepoint that reads from config files</title><link>http://weblogs.asp.net/nathanyorke/archive/2007/12/19/infopath-form-deployed-to-sharepoint-reading-from-config-files.aspx</link><pubDate>Thu, 20 Dec 2007 00:25:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5475435</guid><dc:creator>Yorkenw06</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/nathanyorke/rsscomments.aspx?PostID=5475435</wfw:commentRss><comments>http://weblogs.asp.net/nathanyorke/archive/2007/12/19/infopath-form-deployed-to-sharepoint-reading-from-config-files.aspx#comments</comments><description>&lt;b&gt;Problem:&amp;nbsp;&lt;/b&gt;&lt;p&gt;If you do not use InfoPath and or Sharepoint you can skip this post.&amp;nbsp; When developing InfoPath forms in Visual Studio 2005 that are deployed on Sharepoint you can add an app.config file and one would think that you could use it as in any other project, heck you even get access to the System.Configuration namespace.&amp;nbsp; Everything even compiles gracefully, however, when you run your InfoPath form you will quickly realize that it does not work. This is because all the InfoPath template info is built into a single .xsn template file that will be downloaded to a users local machine when they open an InfoPath form from Sharepoint. No other file, like an app.config, will be downloaded.&amp;nbsp; Everything from here is ran off the client machine (remember a user needs InfoPath installed in order to run non web compliant forms).&lt;br&gt;&lt;br&gt;&lt;b&gt;Solution:&lt;/b&gt; &lt;/p&gt;&lt;p&gt;Instead of hard coding different values for development and production then forgetting to switch the values depending on the deployed environment a solution is to create a custom config file.&amp;nbsp; We can read a custom xml file (or any file of you choice for that matter) that exists back on the Sharepoint server where your InfoPath template was downloaded from. In .Net we can simply make a Web Request back to the server and set our configs settings programmatically in the code.&lt;/p&gt;&lt;p&gt;Tip: If you open IE and go to File --&amp;gt; Open (check "Open as web folder") then paste the root path of the document library where you InfoPath template is deployed we can see all the files from the database.&amp;nbsp; This is where you will want to store your custom config file.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/nathanyorke/InfoPathConfig.JPG" mce_href="http://weblogs.asp.net/blogs/nathanyorke/InfoPathConfig.JPG"&gt;&lt;img src="http://weblogs.asp.net/blogs/nathanyorke/InfoPathConfig.JPG" mce_src="http://weblogs.asp.net/blogs/nathanyorke/InfoPathConfig.JPG" border="0"&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;br&gt;In the FormEvents_Loading method you will first want to call your method to set the configuration settings.&amp;nbsp; The first "if" statement determines if the form was downloaded and ran from you Sharepoint server or is from you local machine when developing.&amp;nbsp; If true, it will have the extra string above in the uri.&amp;nbsp; We will then have to slice the uri a bit and make a web request to pull in the contents of the config file into an Xml document object.&amp;nbsp; If the template is not from Sharepoint (this is here for development since the template is then being executed locally) will need to read the file from our local disk and not the web. Then it is possible to just XPath our configuration settings and set the proper values for our variables. You most likey will have to modify the code above a lot to fit you needs as it is specific to my situation, but it should be good enough to get your juices flowing.&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5475435" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/nathanyorke/archive/tags/Sharepoint/default.aspx">Sharepoint</category><category domain="http://weblogs.asp.net/nathanyorke/archive/tags/InfoPath/default.aspx">InfoPath</category><category domain="http://weblogs.asp.net/nathanyorke/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Uploading multiple files logically via the web</title><link>http://weblogs.asp.net/nathanyorke/archive/2007/12/05/uploading-multiple-files-via-the-web.aspx</link><pubDate>Thu, 06 Dec 2007 00:32:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5408963</guid><dc:creator>Yorkenw06</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/nathanyorke/rsscomments.aspx?PostID=5408963</wfw:commentRss><comments>http://weblogs.asp.net/nathanyorke/archive/2007/12/05/uploading-multiple-files-via-the-web.aspx#comments</comments><description>Trying to upload multiple files easily on the web is not a very intuitive
thing.&amp;nbsp;&amp;nbsp; I am not sure why you can only select one file at a time
though a &amp;lt;input id="fileToUplad" type="file" /&amp;gt; tag
even though you can add multiple files to a request. Hopeful somebody has an
answer for me, but it is what it is.&amp;nbsp; I know that you can dynamically add
file input boxes though the DOM, but this is still tedious because you still
have to select each file one at a time. &lt;o:p&gt;&lt;/o:p&gt;

&lt;p&gt;If you have ever used Sharepoint you might have noticed (if you were using
IE) that there is an option to upload multiple files and it add a folder
explorer view in your page! At the time I was working on a project where the
users wanted to use this type of file picker to upload numerous photos at one
time.&amp;nbsp; Upon further investigation I discovered that it was the &lt;span class="inprocserver32"&gt;STSUPLD.DLL that came with Office 2003.&lt;/span&gt; Below is
some code that will allow you to use this control in an Asp.Net page and have
the collection of files on the server side, so you can programmatically decide
what to do with them.&amp;nbsp; This solution will work for users with IE and
office 2003 or above.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;a href="http://weblogs.asp.net/blogs/nathanyorke/1.jpg" mce_href="http://weblogs.asp.net/blogs/nathanyorke/1.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/nathanyorke/1.jpg" mce_src="http://weblogs.asp.net/blogs/nathanyorke/1.jpg" border="0"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;*Notice the &lt;b&gt;object &lt;/b&gt;tag: &lt;/p&gt;&lt;p&gt;&amp;lt;object id="objMultiUpload" name="objMultiUpload" classid="CLSID:07B06095-5687-4d13-9E32-12B4259C9813" width="100%" height="350px"&amp;gt;&amp;lt;/object&amp;gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The only thing is when using the multiple file upload control it causes the page to load again and not a postback. However it can be tricked by adding a value to the query string and then checking the value in the code.&amp;nbsp; To see it in action you can download the attached code. &lt;br&gt;&lt;/p&gt;

&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5408963" width="1" height="1"&gt;</description><enclosure url="http://weblogs.asp.net/nathanyorke/attachment/5408963.ashx" length="3182" type="application/zip" /><category domain="http://weblogs.asp.net/nathanyorke/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/nathanyorke/archive/tags/Sharepoint/default.aspx">Sharepoint</category></item></channel></rss>