<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2663297772371016015</id><updated>2012-01-20T00:13:48.284+02:00</updated><category term='Visual Studio'/><category term='ASP.NET 2.0'/><category term='Content Type'/><category term='WMI'/><category term='Database'/><category term='Subsonic'/><category term='SQL Reports'/><category term='Tools'/><category term='MOSS'/><category term='Master Pages'/><category term='Indexing Service'/><category term='ASP.NET MVC'/><category term='Hello World'/><title type='text'>Technical Tips &amp; Tricks</title><subtitle type='html'>All about Microsoft Technologies - Tips, Tricks and Tweaks</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-4967356256305745997</id><published>2010-08-06T18:04:00.001+02:00</published><updated>2010-08-06T18:04:06.595+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Reports'/><title type='text'>Adjusting Reporting Services Report width into A4 size.</title><content type='html'>&lt;p&gt;I always had issues regarding exporting the reports into PDF, would result in pages split horizontally into 2 pages. The trick is simply changing the report width, and margins in the report properties.&lt;/p&gt; &lt;p&gt;Report &amp;gt; Report Properties&lt;/p&gt; &lt;p&gt;Choose the layout tab, and change the values as following:&lt;/p&gt; &lt;p&gt;Columns: 1&lt;br&gt;Spacing: 0.5&lt;br&gt;Page Width: 8.27 in&lt;br&gt;Page Height: 11 in&lt;br&gt;Left Margin: 0.1 in&lt;br&gt;Right Margin: 0.1 in&lt;br&gt;Top Margin: 1 in&lt;br&gt;Bottom Margin: 1 in&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_9eoDpEQOERU/TFwybZ6VydI/AAAAAAAAAKQ/3vptn5maiCw/s1600-h/A4%5B6%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="SSRS AhmedIG" border="0" alt="SSRS AhmedIG" src="http://lh3.ggpht.com/_9eoDpEQOERU/TFwydKkKY5I/AAAAAAAAAKU/Tr-bmAD4ABE/A4_thumb%5B4%5D.jpg?imgmax=800" width="444" height="396"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;That would do it for you.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-4967356256305745997?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/4967356256305745997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2010/08/adjusting-reporting-services-report.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/4967356256305745997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/4967356256305745997'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2010/08/adjusting-reporting-services-report.html' title='Adjusting Reporting Services Report width into A4 size.'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_9eoDpEQOERU/TFwydKkKY5I/AAAAAAAAAKU/Tr-bmAD4ABE/s72-c/A4_thumb%5B4%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-9002529103235278480</id><published>2009-12-31T00:53:00.001+02:00</published><updated>2009-12-31T00:55:45.785+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Reports'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Drilling 2 steps in Reports Viewer 2005</title><content type='html'>&lt;p&gt;Imagine a situation where you have a report that has a link to another report. The other report also has a link to another third report. This sounds logical and easy, and it works perfectly in the report server viewer. But when you try to deploy your reports and view them using the report viewer you have in Visual Studio 2005, it throws an exception:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#ff0000"&gt;The path of the item "(null)" is not valid. The path must be less than 260 characters long and must start with slash. Other restrictions apply. (rsInvalidItemPath)&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;As far as I know, this problem is only available in the report viewer of Visual studio 2005. I worked out a work around for this issue.&lt;/p&gt;&lt;span class="fullpost"&gt; &lt;h3&gt;The Idea:&lt;/h3&gt; &lt;p&gt;You have to handle the event of drilling and tell the report viewer to cancel the event, collect the parameters of the new report and set them, and finally set the report path of the report viewer to the new path. Now you are done. Have a look at the code below.&lt;/p&gt; &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 63.94%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; height: 210px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt; &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ReportViewer_Drillthrough(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, DrillthroughEventArgs e)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// This version of the report viewer doesnt support the nested reports&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// this section is used to rerender the whole thing.&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] values = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Get All possible parameters that this report takes&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     ReportParameterInfoCollection reportParms = e.Report.GetParameters();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Create an empty list of parameters that i will send&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     List&amp;lt;ReportParameter&amp;gt; parms = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;ReportParameter&amp;gt;();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (ReportParameterInfo i &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; reportParms)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;     {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// if the parameter value in nullable, and I didnt choose to send a value&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (i.Values.Count == 0)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;continue&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (i.Values.Count &amp;gt; 1)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;         {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;             values = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[i.Values.Count];&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;             i.Values.CopyTo(values, 0);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;             parms.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReportParameter(i.Name, values));&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;         }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;         {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;             parms.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReportParameter(i.Name, i.Values[0]));&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;         }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt;     }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Now reset the viewer, as if its a new request&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum30"&gt;  30:&lt;/span&gt;     ReportViewer.Reset();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum31"&gt;  31:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Cancel the drilling action&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum32"&gt;  32:&lt;/span&gt;     e.Cancel = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum33"&gt;  33:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Reset the ReportServerURL, this is optional.&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum34"&gt;  34:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// If you dont know what to write here, try removing it.&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum35"&gt;  35:&lt;/span&gt;     ReportViewer.ServerReport.ReportServerUrl = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Uri(Session[&lt;span style="color: #006080"&gt;"SSRS Server"&lt;/span&gt;].ToString());&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum36"&gt;  36:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Set the new report that will be displayed, and set its parameters&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum37"&gt;  37:&lt;/span&gt;     ReportViewer.ServerReport.ReportPath = e.ReportPath;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum38"&gt;  38:&lt;/span&gt;     ReportViewer.ServerReport.SetParameters(parms);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum39"&gt;  39:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;One draw back of this solution, is that the back button of the report viewer is not effective anymore. On the other hand, the browser's back navigation button is effective, and can take you to the previous parent report. However, if you clicked any other link in the parent report, it will throw an exception:&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;p&gt;&lt;font color="#ff0000"&gt;Execution 'vzlnjkfdkub0oan53dig5g55' cannot be found &lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;I thought of a solution, which I don't know is acceptable for you or not, which is disabling the browser's back button using JavaScript (see below), and adding a navigation expression in my report. i.e. adding a textbox in the report, with text something like "&amp;lt;&amp;lt; Back" which jumps to the parent report, and sending the needed parameters.&lt;/p&gt;&lt;br /&gt;&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 49.73%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; height: 74px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;&lt;br /&gt;&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &amp;lt;script language=&lt;span style="color: #006080"&gt;"javascript"&lt;/span&gt; type=&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt; &amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     history.forward();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-9002529103235278480?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/9002529103235278480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2009/12/drilling-2-steps-in-reports-viewer-2005.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/9002529103235278480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/9002529103235278480'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2009/12/drilling-2-steps-in-reports-viewer-2005.html' title='Drilling 2 steps in Reports Viewer 2005'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-5450624438489449469</id><published>2009-09-21T02:54:00.003+02:00</published><updated>2009-11-21T01:33:42.768+02:00</updated><title type='text'>Setting A report's Data Source to a Shared Data Source Programmatically</title><content type='html'>One of the things that you will surely need when adding reports to the reporting service programmatically, is setting its data source to the shared data source you have in the reporting server. I personally had this problem and I thought that "I can create a new DataSource Object, then use the SetItemDataSources method to attach this data source to the report". That's what I actually did, but I always had an exception telling me that, The data source ABC is not found, although am sure that the data source name is the same like the shared data source's name.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;What I found out later is, the SetItemDataSources method searches the report's data sources for the name you have set, i.e this name is not the shared data sources' name, but the data sources that is in the rdl file (in the &amp;lt;DataSources&amp;gt; tag).&lt;br /&gt;So in order to fix that, we need to tell the reporting service that the report's data source with the name X (which we will see how to find it out) is still there, but it will reference to the shared data source.&lt;br /&gt;so now lets get our hands dirty with some code.&lt;br /&gt;&lt;h3&gt;How to&lt;/h3&gt;&lt;blockquote&gt;//Get the Shared Data Source&lt;br /&gt;DataSource[] ds = GetSharedDataSource(service, reportsFolder, reportName);  &lt;br /&gt;// Set Report's DataSource&lt;br /&gt;service.SetItemDataSources(@"/" + reportsFolder + @"/" + reportName, ds);&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;public static DataSource[] GetSharedDataSource(ReportingService2005 service, string reportsFolder, string reportName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataSourceReference reference = new DataSourceReference();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataSource ds = new DataSource();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reference.Reference = "/" + reportsFolder + "/" + "SharedDataSource";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ds.Item = (DataSourceDefinitionOrReference)reference; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Get original report Data Source Name&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataSource[] reportDataSource = service.GetItemDataSources(@"/" + reportsFolder&amp;nbsp; + @"/" + reportName);  &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ds.Name = reportDataSource[0].Name;  &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return new DataSource[] { ds };&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-5450624438489449469?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/5450624438489449469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2009/09/setting-report-data-source-to-shared.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/5450624438489449469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/5450624438489449469'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2009/09/setting-report-data-source-to-shared.html' title='Setting A report&amp;#39;s Data Source to a Shared Data Source Programmatically'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-7642633813207398472</id><published>2009-05-29T22:21:00.001+02:00</published><updated>2009-11-21T01:41:58.380+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET MVC'/><category scheme='http://www.blogger.com/atom/ns#' term='Subsonic'/><title type='text'>Building your ASP.NET MVC application with Subsonic 3.0</title><content type='html'>&lt;p&gt;&lt;a href="http://subsonicproject.com/" target="_blank"&gt;Subsonic&lt;/a&gt; really rocks... I loved &lt;a href="http://subsonicproject.googlecode.com/files/SubSonic_2.1_Final_Source.zip" target="_blank"&gt;Subsonic 2.0&lt;/a&gt; and took the risk of starting a huge application using Subsonic a year ago while it wasn't that popular when comparing it to other DAL generators like .NetTiers template of &lt;a href="www.codesmithtools.com/" target="_blank"&gt;codesmith&lt;/a&gt;. But to be honest, I loved subsonic since then very much, being so easy, light, straight forward, not complex, and what is the most important, getting things done just the way I want them.&lt;/p&gt;&lt;p&gt;Suddenly, &lt;a href="blog.wekeroad.com/" target="_blank"&gt;Rob Conery&lt;/a&gt; introduced the new Subsonic 3.0 which is targeting the ASP.NET MVC technology. This sounds really great, and I liked the idea so much, but the question is.. Where can I learn it from? So far, all screen casts that Rob did are kind of "showing off" the new subsonic. Nothing published so far showing you how to create an application from scratch using Subsonic on Database called XYZ for instance like he used to do with earlier versions. Maybe he is waiting for the final release of Subsonic 3.0 to do so.&lt;/p&gt;&lt;p&gt;I liked &lt;a href="blog.wekeroad.com/" target="_blank"&gt;Rob Conery's&lt;/a&gt; comment that he added in Preview 2's package. It was something like "This is a Preview version.. so BE GENTLE". &lt;/p&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;p&gt;Anyway, I am really waiting for this version of subsonic, I guess it will be a good plus for using ASP.NET MVC.&lt;/p&gt;&lt;p&gt;Now lets talk about Subsonic, and how to get your application working using subsonic 3.0. Please note, that Subsonic 3.0 is a brand new tool, and am not that good in it. I learnt that from trial errors, so don't hesitate to correct me if am wrong in anything am posting.&lt;/p&gt;&lt;h3&gt;Prerequisites&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Install MVC into your visual studio from &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=53289097-73ce-43bf-b6a6-35e00103cb4b&amp;amp;displaylang=en" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;li&gt;Install Subsonic Template from &lt;a href="http://subsonicproject.googlecode.com/files/SubSonic%20MVC%20Template.zip" target="_blank"&gt;here&lt;/a&gt;.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;p&gt;Installation of the MVC on Visual Studio is a straight forward issue. You have to run the msi file and you are done.&lt;/p&gt;&lt;p&gt;For subsonic, Place the zipped file you downloaded into the following directory (My Documents\Visual Studio 2008\Templates\ProjectTemplates\Visual Web Developer\Web). Don't extract the zip file, but keep it there as it is. &lt;/p&gt;&lt;h3&gt;Starting your application&lt;/h3&gt;&lt;p&gt;Open Visual Studio. Then from the files menu, Create a new Project.&lt;/p&gt;&lt;p&gt;As shown below. Choose the Subsonic MVC Template, then press ok.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_9eoDpEQOERU/SiBPPZdgWII/AAAAAAAAAEE/IsAa087eGbA/s1600-h/1%5B6%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="1" border="0" alt="1" src="http://lh3.ggpht.com/_9eoDpEQOERU/SiBPRAG6ctI/AAAAAAAAAEI/FuDBRYs8fcw/1_thumb%5B3%5D.gif?imgmax=800" width="695" height="502"&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;The solution structure will look exactly like that:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_9eoDpEQOERU/SiBPSE5YNRI/AAAAAAAAAEM/4qSxWjF3Lv4/s1600-h/SolutionStructure%5B3%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SolutionStructure" border="0" alt="SolutionStructure" src="http://lh5.ggpht.com/_9eoDpEQOERU/SiBPTZ2DwsI/AAAAAAAAAEQ/0S3IacN_bqg/SolutionStructure_thumb%5B1%5D.gif?imgmax=800" width="204" height="398"&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Now, open the web.config file, and edit the connection strings. This is the main part, as everything is based upon the DB you are using. The whole DAL will be generated according to the Database. Dont forget to change the Database name as well. We will later make the subsonic get to know the new name.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&amp;lt;connectionStrings&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="Chinook" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|Chinook.mdf;User Instance=true" providerName="System.Data.SqlClient"/&amp;gt;&amp;lt;/connectionStrings&amp;gt; &lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Now here we come to the tricky part, that caused me a lot of confusions. I used to miss this part and end up all the time hitting my head against the wall.  &lt;p&gt;Open the Model/_settings.tt file. This is one of the T4 templates subsonic is using. Edit this part:  &lt;blockquote&gt;&lt;p&gt;const string Namespace = "SubSonic.Web.Models";const string ConnectionStringName="Chinook"; &lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Now you can change the ConnectionStringName to the name you defined in the web.config section, then save the file.&lt;/p&gt;&lt;h3&gt;Creating the DAL &lt;/h3&gt;&lt;p&gt;Right click on the _settings.tt file, and select the "Run Custom tool" option as shown below. Repeat this step with the 4 Template files in the Models directory.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_9eoDpEQOERU/SiBPUbdG87I/AAAAAAAAAEU/H5GC7gUDRFI/s1600-h/RunCustomTool%5B3%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="RunCustomTool" border="0" alt="RunCustomTool" src="http://lh3.ggpht.com/_9eoDpEQOERU/SiBPVDA-sKI/AAAAAAAAAEY/uW9FOCRvUz8/RunCustomTool_thumb%5B1%5D.gif?imgmax=800" width="302" height="263"&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;You will find some warning messages in the error list while running the template files; just neglect them. Always try to remember Rob's phrase I stated earlier; "Be Gentle, this is a preview version" ;) So I guess it's better to choose not to show the warning messages in the error list :)&lt;/p&gt;&lt;p&gt;Now time to build. Oops, 3 errors? Let me tell you that now you can say "I successfully generated my DAL using Subsonic!!" They are as simple as adding this line "using SubSonic.Web.Models;" into HtmlExtensions.cs and SubsonicRepository.cs files.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_9eoDpEQOERU/SiBPWKfrmyI/AAAAAAAAAEc/GglKou4FX6I/s1600-h/errorList%5B3%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="errorList" border="0" alt="errorList" src="http://lh4.ggpht.com/_9eoDpEQOERU/SiBPW-Twl7I/AAAAAAAAAEg/eogDWAbpa1c/errorList_thumb%5B1%5D.gif?imgmax=800" width="721" height="192"&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Now we are done.&lt;/p&gt;&lt;p&gt;You can learn how to create the Models, Views, and controllers using subsonic's tools, I recommend watching Rob's &lt;a href="http://silverlight.services.live.com/58326/MVC%20Template%20Pre-release/video.wmv" target="_blank"&gt;screencast&lt;/a&gt;. Although he showed everything quickly and without any explanations, but I think it doesn't need any.&lt;/p&gt;&lt;p&gt;Correct me if am wrong in any of the tips I stated. I told you, no one knows better than the other when it comes to beta editions of software ;)&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-7642633813207398472?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/7642633813207398472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2009/05/building-your-aspnet-mvc-application.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/7642633813207398472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/7642633813207398472'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2009/05/building-your-aspnet-mvc-application.html' title='Building your ASP.NET MVC application with Subsonic 3.0'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_9eoDpEQOERU/SiBPRAG6ctI/AAAAAAAAAEI/FuDBRYs8fcw/s72-c/1_thumb%5B3%5D.gif?imgmax=800' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-6142152287786879694</id><published>2009-04-05T03:58:00.002+02:00</published><updated>2009-11-21T02:00:56.905+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Indexing Service'/><title type='text'>Creating your own site's search Engine</title><content type='html'>&lt;p&gt;Setting up you search page for your web application is as easy as having a DB table where you retrieve data from by a simple query. I will illustrate the steps of setting up the configurations needed in this post, and will write another one for detailed stuff in custom search page. So lets start.&lt;/p&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;h3&gt;Setting up your Search Index&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;start&amp;gt;run&amp;gt; type mmc &lt;br /&gt;&lt;li&gt;in the new window, File&amp;gt; Add Remove Snap-in, or press CTRL + M as a shortcut &lt;br /&gt;&lt;li&gt;Press Add, and choose Indexing Service from the List box as shown below&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_9eoDpEQOERU/SdgP3CyrAcI/AAAAAAAAACs/TilDfHa8R5U/s1600-h/clip_image001%5B4%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://lh4.ggpht.com/_9eoDpEQOERU/SdgP4ZRupoI/AAAAAAAAACw/pj7NDIUQf-g/clip_image001_thumb%5B1%5D.gif?imgmax=800" width="384" height="398"&gt;&lt;/a&gt;&lt;br /&gt;Press the Add button. &lt;br /&gt;&lt;li&gt;A dialog box will appear asking you about the Computer name you want to apply the Indexing on, choose the local computer for this Demo.&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_9eoDpEQOERU/SdgP5Q2AfEI/AAAAAAAAAC0/RnnIqCM9t98/s1600-h/clip_image002%5B4%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://lh6.ggpht.com/_9eoDpEQOERU/SdgP6UdYHaI/AAAAAAAAAC4/bdXVGhKmGrM/clip_image002_thumb%5B1%5D.gif?imgmax=800" width="441" height="235"&gt;&lt;/a&gt; &lt;br /&gt;&lt;li&gt;Close all dialogs you have on your screen until you reach your Console Window, with Indexing Service running. &lt;br /&gt;&lt;li&gt;Right Click on the Indexing Service node under the Console Root, and choose New&amp;gt;Catalog.&lt;br /&gt;Make sure that the Start option in the menu is activated before doing this step, otherwise, you have to stop the service first.&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_9eoDpEQOERU/SdgP8FBsVSI/AAAAAAAAAC8/0Ftflda5Rp0/s1600-h/clip_image003%5B4%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image003" border="0" alt="clip_image003" src="http://lh6.ggpht.com/_9eoDpEQOERU/SdgP9T0QJdI/AAAAAAAAADA/Bwa9ifwMVY4/clip_image003_thumb%5B1%5D.gif?imgmax=800" width="502" height="264"&gt;&lt;/a&gt; &lt;br /&gt;&lt;li&gt;Give the new Catalog any Name. I will call it PP4.&lt;br /&gt;Browse to a directory where the Catalog file will be stored in. This is not the directory which you want to Index.&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_9eoDpEQOERU/SdgP-CXbISI/AAAAAAAAADE/CTB-hLVzMqk/s1600-h/clip_image004%5B4%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://lh5.ggpht.com/_9eoDpEQOERU/SdgP-xQhhnI/AAAAAAAAADI/iOMIHvaHdQI/clip_image004_thumb%5B1%5D.gif?imgmax=800" width="347" height="172"&gt;&lt;/a&gt; &lt;br /&gt;&lt;li&gt;You will find a new node called PP4 just appeared under the Indexing Service node.&lt;br /&gt;Now we want to tell the new Catalog to search in your site. Right click on the PP4 Catalog, and choose New&amp;gt;Directory&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_9eoDpEQOERU/SdgQAEyYKSI/AAAAAAAAADM/RQ4wC2vV7cM/s1600-h/clip_image005%5B4%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image005" border="0" alt="clip_image005" src="http://lh4.ggpht.com/_9eoDpEQOERU/SdgQBoQhqBI/AAAAAAAAADQ/4kgBhbv4nPE/clip_image005_thumb%5B1%5D.gif?imgmax=800" width="500" height="263"&gt;&lt;/a&gt; &lt;br /&gt;&lt;li&gt;Now fill in the Data as below&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_9eoDpEQOERU/SdgQCo_-XqI/AAAAAAAAADU/0c3s9IxZ7NI/s1600-h/clip_image006%5B4%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://lh4.ggpht.com/_9eoDpEQOERU/SdgQDal-QKI/AAAAAAAAADY/WmwRwvrHgjc/clip_image006_thumb%5B1%5D.gif?imgmax=800" width="398" height="261"&gt;&lt;/a&gt;&lt;br /&gt;The Path, is the Physical Path of the website you'd like to Index. Finally press OK. &lt;br /&gt;&lt;li&gt;Now right click on the PP4 Catalog, and choose Properties. Go to the tracking tab, and change the WWW server to your Default Website.&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/_9eoDpEQOERU/SdgQFC72GSI/AAAAAAAAADc/EMkIp0qjNcA/s1600-h/clip_image007%5B4%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image007" border="0" alt="clip_image007" src="http://lh6.ggpht.com/_9eoDpEQOERU/SdgQG2yS1hI/AAAAAAAAADg/jtDRU39Ycdg/clip_image007_thumb%5B1%5D.gif?imgmax=800" width="395" height="426"&gt;&lt;/a&gt; &lt;br /&gt;&lt;li&gt;Now go to the Generation tab, and uncheck the checkbox "Inherit above settings from Service".&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_9eoDpEQOERU/SdgQIhS_GKI/AAAAAAAAADk/WiVD8UkU9a8/s1600-h/clip_image008%5B4%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://lh6.ggpht.com/_9eoDpEQOERU/SdgQKqh3dRI/AAAAAAAAADo/BW3Rg8wvnOI/clip_image008_thumb%5B1%5D.gif?imgmax=800" width="395" height="426"&gt;&lt;/a&gt;&lt;br /&gt;It Enables by default the "Generate abstracts" checkbox. This tells the search index, to get some text from the searched pages, just like Google.com for instance when they get you a sample text under each item in the search result. The default is not generate any abstracts. This text is by default the first 320 characters in the page. You can customize that just by adding some text in the "description" meta tag in the HTML's head section.&lt;br /&gt;&lt;li&gt;Now start the Service.&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_9eoDpEQOERU/SdgQL5WmRqI/AAAAAAAAADs/jz8Hs1c4syQ/s1600-h/clip_image009%5B4%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image009" border="0" alt="clip_image009" src="http://lh5.ggpht.com/_9eoDpEQOERU/SdgQNGYcxbI/AAAAAAAAADw/tTZBHmq9xHw/clip_image009_thumb%5B1%5D.gif?imgmax=800" width="550" height="284"&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;p&gt;Now we are done with setting up the search index configurations. Next you have to create a page that calls this catalog for searching. But before doing this, lets try to figure out whether everything is working fine or not.  &lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;/p&gt;&lt;h3&gt;Querying your Search Index through the built in page&lt;/h3&gt;&lt;p&gt;Under the PP4 Catalog we have just created, you will find a node called "Query the Catalog". Press on that node and a page will load up at the right part of the window as shown below. Here you can try by typing "Partners" for instance, and have a look at the query result. As you can see, the query includes .cs, .vb, .css files and many other types of unwanted files. you can control that by creating your own page, using your own code.  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_9eoDpEQOERU/SdgQO-NIv2I/AAAAAAAAAD0/B2033fKfjOU/s1600-h/clip_image010%5B5%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image010" border="0" alt="clip_image010" src="http://lh4.ggpht.com/_9eoDpEQOERU/SdgQQuY5HwI/AAAAAAAAAD4/slKGrP2IlDk/clip_image010_thumb%5B2%5D.gif?imgmax=800" width="556" height="480"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h3&gt;Querying your Search Index through a custom page using Query Language&lt;/h3&gt;&lt;p&gt;I will go through the main parts of the query, and you can figure out the rest. It's as if you are querying a simple SQL Database and binding the results to a Repeater.  &lt;p&gt;&lt;u&gt;Connection:&lt;/u&gt;  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OleDbConnection odbSearch = new OleDbConnection( "Provider=\"MSIDXS\";Data Source=\"PP4\";");  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please note that the Data Source is the Catalog name you specified in the Search Index configurations.  &lt;p&gt;&lt;u&gt;Command:&lt;/u&gt;  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmdSearch.Command Text = "select doctitle, filename, vpath, rank, characterization from scope() where FREETEXT(Contents, '"+ searchText +"') order by&amp;nbsp; rank desc ";  &lt;p&gt;Where the "searchText" is the text you typed in the textbox for searching.  &lt;p&gt;The rest is as easy as executing the query and binding the results to a repeater.I have made one on my own and took a snap shot of the running program below:  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_9eoDpEQOERU/SdgQTAkblwI/AAAAAAAAAD8/ieqH2XY92dg/s1600-h/clip_image011%5B8%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image011" border="0" alt="clip_image011" src="http://lh3.ggpht.com/_9eoDpEQOERU/SdgQVbw1lNI/AAAAAAAAAEA/w8GghOPXio4/clip_image011_thumb%5B5%5D.gif?imgmax=800" width="531" height="480"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-6142152287786879694?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/6142152287786879694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2009/04/creating-your-own-site-search-engine.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/6142152287786879694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/6142152287786879694'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2009/04/creating-your-own-site-search-engine.html' title='Creating your own site&amp;#39;s search Engine'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_9eoDpEQOERU/SdgP4ZRupoI/AAAAAAAAACw/pj7NDIUQf-g/s72-c/clip_image001_thumb%5B1%5D.gif?imgmax=800' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-4756392299363335774</id><published>2008-11-26T14:18:00.002+02:00</published><updated>2009-11-21T02:03:46.435+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Visual Studio Themes Gallery</title><content type='html'>&lt;p&gt;Tired of the default color theme you are using in Visual Studio? the ordinary white background, black text, blue keywords, and the green comments..&lt;/p&gt;&lt;p&gt;For me, I wished I could find a nice neat theme that would change everything up, and make the Visual Studio look so much different (kind of fooling myself &lt;img alt="Open-mouthed" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/teeth_smile.gif"&gt;).&lt;/p&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;p&gt;Anyway, have a look at these images bellow.. and think again &lt;img alt="Wink" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/wink_smile.gif"&gt;&lt;/p&gt;&lt;p&gt;&lt;img src="http://www.hanselman.com/blog/content/binary/WindowsLiveWriter/VisualStudioProgrammerThemesGallery_CF56/ide_colors_regular_3.png"&gt; &lt;/p&gt;&lt;p&gt;&lt;img src="http://www.hanselman.com/blog/content/binary/WindowsLiveWriter/VisualStudioProgrammerThemesGallery_CF56/image_40.png"&gt; &lt;/p&gt;&lt;p&gt;&lt;img src="http://www.hanselman.com/blog/content/binary/WindowsLiveWriter/VisualStudioProgrammerThemesGallery_CF56/image_6.png"&gt; &lt;/p&gt;&lt;p&gt;Visit this &lt;a href="http://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx" target="_blank"&gt;page&lt;/a&gt; for a good downloadable collection..&lt;a href="http://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx" target="_blank"&gt;Press here&lt;/a&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-4756392299363335774?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/4756392299363335774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2008/11/visual-studio-themes-gallery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/4756392299363335774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/4756392299363335774'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2008/11/visual-studio-themes-gallery.html' title='Visual Studio Themes Gallery'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-5038806982711355152</id><published>2008-08-12T20:13:00.002+02:00</published><updated>2009-11-21T02:04:17.435+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MOSS'/><title type='text'>Creating a Custom SharePoint MasterPage using a Feature</title><content type='html'>&lt;p&gt;Creating a custom MasterPage is a very common requirement especially for those who want to migrate from ASP.NET 2.0 to SharePoint, without altering the look and feel they already had previously.  &lt;p&gt;I have searched a lot about how to accomplish this, and found many articles and blog posts but they are all incomplete, they are missing the complete guide. I will try to be as direct as possible, and include screen shots that I hope they would help.&lt;/p&gt;&lt;p&gt;Anyway, lets start and get our hands dirty...&lt;/p&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Navigate to the following folder: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\&lt;br /&gt;Copy the PageLayouts folder and paste it in the same directory but Change the folder name to another one. To easily follow up with me through this post, lets call it CustomMasterPages.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://i33.tinypic.com/ip048k.gif"&gt;&lt;img src="http://i33.tinypic.com/ip048k.gif"&gt;&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Add the masterpage you want in the masterpage folder, the CSS file into the styles folder, and all images you need into the images folder.&lt;br /&gt;&lt;li&gt;Open the CustomMasterPages folder. Now we have to Edit the Feature.xml that has the main Registry info about the new feature you want to create (in our case, the custom MasterPage). So open the feature.xml file using your favorite text editor.&lt;br /&gt;Delete what the file has, and paste the following:  &lt;blockquote&gt;&lt;p style="background-color: #fffaf0"&gt;&amp;lt;!-- _lcid="1033" _version="12.0.4518" _dal="1" --&amp;gt;&lt;br /&gt;&amp;lt;!-- _LocalBinding --&amp;gt;&lt;br /&gt;&amp;lt;Feature&amp;nbsp; Id="&lt;font color="#ff0000"&gt;77596cae-c12d-4451-9d65-53b66b2fd5aa&lt;/font&gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title="&lt;font color="#ff0000"&gt;CS Masterpage&lt;/font&gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description="&lt;font color="#ff0000"&gt;My own Custom MasterPage&lt;/font&gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Version="12.0.0.0"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Scope="Site"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hidden="False"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DefaultResourceFile="core"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns="&lt;a href="http://schemas.microsoft.com/sharepoint/&amp;quot;"&gt;http://schemas.microsoft.com/sharepoint/"&lt;/a&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ElementManifests&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ElementManifest Location="ProvisionedFiles.xml"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ElementManifests&amp;gt;&lt;br /&gt;&amp;lt;/Feature&amp;gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;You have to change only the following fields, but I advice you to leave everything as it is for this Demo, just as a good kick off :)&lt;br /&gt;ID: A GUID to identify the feature. you can go to &lt;a title="http://www.newguid.com/" href="http://www.newguid.com/"&gt;http://www.newguid.com/&lt;/a&gt; to generate a new GUID (you will find it in the upper banner) and paste it right there.&lt;br /&gt;Title: the Feature name (Custom MasterPage name).&lt;br /&gt;Description: Feature's description.&lt;br /&gt;The Element Manifest is considered as the backbone of the feature; you have to specify its location, which is by default named as ProvisionedFiles.xml located at the same level with the feature.xml. Save the file and close it.&lt;/p&gt;&lt;li&gt;Now open the ProvisionedFiles.xml file and let's see what we have got there.&lt;br /&gt;You simply link EVERYTHING you have in the CustomMasterPages folder, and create an entry for it in the ProvisionedFiles.xml  &lt;blockquote&gt;&lt;p style="background-color: #fffaf0"&gt;&amp;lt;!-- _lcid="1033" _version="12.0.4407" _dal="1" --&amp;gt;&lt;br /&gt;&amp;lt;!-- _LocalBinding --&amp;gt;&lt;br /&gt;&amp;lt;Elements xmlns="&lt;a href="http://schemas.microsoft.com/sharepoint/&amp;quot;"&gt;http://schemas.microsoft.com/sharepoint/"&lt;/a&gt;&amp;gt; &amp;lt;Module Name="OSGMasterPages" Url="_catalogs/masterpage" Path="MasterPages" RootWebOnly="TRUE"&amp;gt; &lt;br /&gt;&amp;lt;!--the MasterPage file that you have to put in the CustomMasterPage/MasterPages folder --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;File Url="&lt;font color="#ff0000"&gt;MasterPage.master&lt;/font&gt;" Type="GhostableInLibrary"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Property Name="ContentType" Value="My Sample Master Page" /&amp;gt; &lt;br /&gt;&amp;lt;!-- a preview image for the MasterPage file. Put the image in the CustomMasterPage/en-us folder --&amp;gt;&lt;br /&gt;&amp;lt;Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/BlackVertical.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/BlackVertical.png" /&amp;gt;&lt;br /&gt;&amp;lt;!-- MasterPage Description --&amp;gt;&lt;br /&gt;&amp;lt;Property Name="MasterPageDescription" Value="&lt;font color="#ff0000"&gt;This is my sample master page for use with collaboration or publishing sites&lt;/font&gt;." /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/File&amp;gt; &lt;br /&gt;&amp;lt;/Module&amp;gt; &amp;lt;!-- a preview image for the MasterPage file. Put the image in the CustomMasterPage/en-us folder --&amp;gt;&lt;br /&gt;&amp;lt;Module Name="PublishingLayoutsPreviewImages" Url="_catalogs/masterpage" IncludeFolders="??-??" Path="" RootWebOnly="TRUE"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;File Url="BlackVertical.png" Name="Preview Images/BlackVertical.png" Type="GhostableInLibrary"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/File&amp;gt; &lt;br /&gt;&amp;lt;/Module&amp;gt;&lt;br /&gt;&amp;lt;!-- The place where we can add the registry info of the images used in the MasterPage--&amp;gt;&lt;br /&gt;&amp;lt;Module Name="Images" Url="Style Library/Images" Path="Images" RootWebOnly="TRUE"&amp;gt;&lt;br /&gt;&amp;lt;!-- All images that you added previously in the CustomMasterPage\images folder, each will have its own entry as shown below, with the same syntax except the Url, and name. Please take care that they are case sensitive--&amp;gt;&lt;br /&gt;&amp;lt;File Url="&lt;font color="#ff0000"&gt;1_Duane.jpg&lt;/font&gt;" Name="&lt;font color="#ff0000"&gt;1_Duane.jpg&lt;/font&gt;" Type="GhostableInLibrary"/&amp;gt;&lt;br /&gt;&amp;lt;/Module&amp;gt; &amp;lt;!-- Styles, the name of the css file located in the CustomMasterPage\styles folder--&amp;gt;&lt;br /&gt;&amp;lt;Module Name="OSGStyles" Url="Style Library" Path="Styles" RootWebOnly="TRUE"&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;File Url="&lt;font color="#ff0000"&gt;CS MasterPage.css&lt;/font&gt;" Type="GhostableInLibrary" /&amp;gt;&lt;br /&gt;&amp;lt;/Module&amp;gt; &amp;lt;/Elements&amp;gt;  &lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Now we are done with the 2 most important pages. &lt;/p&gt;&lt;li&gt;One important thing you must take care of, is that the masterpage design is not the same as what you used to do in ASP.NET 2.0. Its not an HTML page with some ContentPlaceHolders with random IDs and placed anywhere like before. SharePoint's MasterPages are way different; there are a number of predefined ContentPlaceHolders with specific ids (you can't change them, or they wont be recognized, and the MOSS will hit you with a silly frustrating error page!). These ContentPlaceHolders are recognized by the MOSS according to their IDs. Have a look at the complete list below:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://i33.tinypic.com/nv3zx5.jpg"&gt;&lt;img height="304" src="http://i33.tinypic.com/nv3zx5.jpg" width="378"&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;yet, you dont have to place ALL of these ContentPlaceHolders into your new customized MasterPage. there are some of these which are essential, and others not. The following is a minimal MasterPage that you cant remove anything from it, or it wont work at all. You can always use it as a start for designing your masterpages.. i.e NEVER START THE MASTERPAGE DESIGN FROM SCRATCH! or you will end up banging your head against the wall!  &lt;blockquote&gt;&lt;p style="background-color: #fffaf0"&gt;&amp;lt;%-- Identifies this page as a .master page written in Microsoft Visual C# and registers tag prefixes, namespaces, assemblies, and controls. --%&amp;gt;&lt;br /&gt;&amp;lt;%@ Master language="C#" %&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "&lt;a href="http://www.w3.org/TR/html4/loose.dtd&amp;quot;"&gt;http://www.w3.org/TR/html4/loose.dtd"&lt;/a&gt;&amp;gt;&lt;br /&gt;&amp;lt;%@ Import Namespace="Microsoft.SharePoint" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Tagprefix="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register TagPrefix="PublishingVariations" TagName="VariationsLabelMenu" src="~/_controltemplates/VariationsLabelMenu.ascx" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Tagprefix="PublishingConsole" TagName="Console" src="~/_controltemplates/PublishingConsole.ascx" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register TagPrefix="PublishingSiteAction" TagName="SiteActionMenu" src="~/_controltemplates/PublishingActionMenu.ascx" %&amp;gt;&lt;br /&gt;&amp;lt;%-- Uses the Microsoft Office namespace and schema. --%&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;WebPartPages:SPWebPartManager runat="server"/&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;SharePoint:RobotsMetaTag runat="server"/&amp;gt;&amp;nbsp;&amp;nbsp; &amp;lt;%-- The head section includes a content placeholder for the page title and links to CSS and ECMAScript (JScript, JavaScript) files that run on the server. --%&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;head runat="server"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder runat="server" id="head"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/title&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:ContentPlaceHolder&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Sharepoint:CssLink runat="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server" /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/head&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;%-- When loading the body of the .master page, SharePoint Server 2007 also loads the SpBodyOnLoadWrapper class. This class handles .js calls for the master page. --%&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;body onload="javascript:_spBodyOnLoadWrapper();"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%-- The SPWebPartManager manages all of the Web part controls, functionality, and events that occur on a Web page. --%&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form runat="server" onsubmit="return _spFormOnSubmitWrapper();"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;wssuc:Welcome id="explitLogout" runat="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;PublishingSiteAction:SiteActionMenu runat="server"/&amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;PublishingWebControls:AuthoringContainer id="authoringcontrols" runat="server"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;PublishingConsole:Console runat="server" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/PublishingWebControls:AuthoringContainer&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%-- The PlaceHolderMain content placeholder defines where to place the page content for all the content from the page layout. The page layout can overwrite any content placeholder from the master page. Example: The PlaceHolderLeftNavBar can overwrite the left navigation bar. --%&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Panel visible="false" runat="server"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%-- These ContentPlaceHolders ensure all default SharePoint Server pages render with this master page. If the system master page is set to any default master page, the only content placeholders required are those that are overridden by your page layouts. --%&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea"&amp;nbsp; runat="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder ID="PlaceHolderPageImage" runat="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder ID="PlaceHolderBodyLeftBorder" runat="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder ID="PlaceHolderNavSpacer" runat="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder ID="PlaceHolderTitleLeftBorder" runat="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder ID="PlaceHolderTitleAreaSeparator" runat="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder ID="PlaceHolderMiniConsole" runat="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" runat ="server" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat ="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat ="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat ="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat ="server"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:Panel&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;So to start, you can get whatever HTML you have in the old MasterPage and paste it in here, just below the &amp;lt;/asp:Panel&amp;gt;. Then arrange the ContentPlaceHolders wherever you want into your HTML code. &lt;br /&gt;Another point you must take care of; the images and background's source urls. of course, we added the images previously into the CustomMasterPages\images folder, so we will replace the old source urls you had in the html code into something like:&lt;br /&gt;background="/Style%20Library/images/bg1.jpg"&amp;gt;&lt;br /&gt;and for sure, that would be the same case in the CSS file. &lt;/p&gt;&lt;li&gt;Now we are ready to install the feature!&lt;br /&gt;open the command prompt (Start&amp;gt; Run), then type:&lt;br /&gt;cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN&lt;br /&gt;Now type the following&lt;br /&gt;stsadm -o installfeature -filename CustomMasterPages\feature.xml&lt;br /&gt;We are installing the feature that we are providing its feature.xml file (the xml file's path from the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES folder). &lt;br /&gt;&lt;li&gt;Activate the feature for your site.&lt;br /&gt;open the Internet Browser, and type in the webapplication's URL.. something like &lt;a href="http://ahmed-ig:35193"&gt;http://ahmed-ig:35193&lt;/a&gt; and concatenate /_layouts/settings.aspx to the previous part.&lt;br /&gt;i.e: &lt;a title="http://ahmed-ig:35193/_layouts/settings.aspx" href="http://ahmed-ig:35193/_layouts/settings.aspx"&gt;http://ahmed-ig:35193/_layouts/settings.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;under the "Site Collection Administration" column, click on "Site collection features"&lt;br /&gt;&lt;br /&gt;&lt;a href="http://i36.tinypic.com/2ikfce9.gif"&gt;&lt;img height="200" src="http://i36.tinypic.com/2ikfce9.gif" width="412"&gt;&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;locate the Feature you have just made. (you will find its name as you named it in the feature.xml file)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://i34.tinypic.com/21opuok.gif"&gt;&lt;img height="193" src="http://i34.tinypic.com/21opuok.gif" width="409"&gt;&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Now Press on the Activate Button to activate the Feature.&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Apply the MasterPage into your site&lt;br /&gt;Now get back to the url you opened in Step #7&lt;br /&gt;and under the "Look and Feel" column, click on "Master page".&lt;br /&gt;Choose the Site Master Page as the customized MasterPage you have created.&lt;br /&gt;and leave the System Master Page as it is.&lt;br /&gt;Now you have to upload the CSS file you are using in your customized MasterPage file.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://i34.tinypic.com/2ez4fp5.gif"&gt;&lt;img height="147" src="http://i34.tinypic.com/2ez4fp5.gif" width="402"&gt;&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;p&gt;And Hopefully, that's it! Hope it works smoothly without any problems :)&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-5038806982711355152?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/5038806982711355152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2008/08/creating-custom-sharepoint-masterpage.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/5038806982711355152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/5038806982711355152'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2008/08/creating-custom-sharepoint-masterpage.html' title='Creating a Custom SharePoint MasterPage using a Feature'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://i33.tinypic.com/ip048k_th.gif' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-602195713851506805</id><published>2008-05-25T16:38:00.002+02:00</published><updated>2009-11-21T02:07:47.336+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Reports'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>A Simple GUI Tool for SQL 2005 Reports deployment without using BI Development Studio</title><content type='html'>&lt;h3&gt;Introduction&lt;/h3&gt;&lt;p&gt;SQL 2005 Reports deployment is done either by choosing the deploy option in the BI Development studio, then specifying the target Server URL and the target Report Folder, which is the standard way, or deploying the reports manually by opening the Report Server URL, and creating the DataSource, the parent Folder where you will add the datasource and report in, and the attaching the Reports manually, which is still not that realistic as you don't have to do all that each time you want to deploy a report. Yet the first option is not always possible, as you may wish to deploy a report while you don't have the BI development Studio installed in your machine. In this article, I expect that you know both techniques before reading, as I won't be explaining in details everything.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;p&gt;I made a simple GUI tool that helps in deploying the SQL Reports by consuming the web service named reportservice.asmx that the SQL Reporting Server produces and hosted by the IIS of the Report server. Usually the Report Server has the URL as: &lt;br /&gt;http://&amp;lt;server name&amp;gt;/ReportServer&lt;br /&gt;and sometimes as http://&amp;lt;server name&amp;gt;/ReportServer$SQLExpress, or http://&amp;lt;server name&amp;gt;/ReportServer$SQL2005. This is according to what you named the SQL server Instance installed. Anyway, let's get back to the main point. The webservice within the ReportsServer web application hosted in the IIS of the server machine actually does everything you need to deploy the Reports you want; I guess it is better to have a look at the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.reportingservice2005_methods.aspx"&gt;ReportingService2005 Methods&lt;/a&gt;.  &lt;p&gt;Anyway... Let's start having a look at the application and the code. First I will be investigating the application, and what does everything means, then we will have a quick review on the main parts of the code.  &lt;h3&gt;How to use the Tool ?&lt;/h3&gt;&lt;p&gt;&lt;img src="http://img301.imageshack.us/img301/9499/sqlrequesturlmm7.gif"&gt; &lt;/p&gt;&lt;p&gt;Once you run the application, a window will appear asking you to enter the Report Manager URL, as to connect to its web service. I.e. it's the same URL you type in the target server URL property when using the BI Development Studio for deployment. The URL you entered is saved then so that you don't have to type it in each and every time you run the application. I use this URL, so as to modify the WebService I am consuming, to connect to the URL you will choose. To know what I mean, just have a look at &lt;a href="http://www.codeproject.com/KB/XML/wsdldynamicurl.aspx"&gt;this article&lt;/a&gt; by &lt;a href="http://www.codeproject.com/MemberArticles.aspx?amid=314543"&gt;Christopher G. Lasater&lt;/a&gt;, that describes what I did actually (Dynamic Web Service).&lt;/p&gt;&lt;p&gt;&lt;img src="http://img301.imageshack.us/img301/1913/sqlmaingj3.gif"&gt; &lt;/p&gt;&lt;p&gt;After the previous step is done, the Web Service now is made ready to do the rest.  &lt;p&gt;Next, to get started, you have to define the following:  &lt;ol&gt;&lt;li&gt;The connection string as the data source.&lt;br /&gt;&lt;li&gt;The Data source name.&lt;br /&gt;&lt;li&gt;The Report source (Physical Path in your machine).&lt;br /&gt;&lt;li&gt;The Report Name (The name that you will give to the Report you just browsed for).&lt;br /&gt;&lt;li&gt;Finally, the folder (a logical folder in the Report Server not a physical folder in your machine) which you will save in it the Reports and the data sources you want. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;p&gt;Finally, after running the Tool successfully, then tried to open the SQL Server Reporting Services Web application, you will find a new Folder as you named in the tool, and has the DataSources and Reports you made as below.  &lt;p&gt;&lt;img src="http://img212.imageshack.us/img212/6578/sqlresultqq7.gif"&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h3&gt;Code Overview&lt;/h3&gt;&lt;p&gt;If you had a look at the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.reportingservice2005_methods.aspx"&gt;ReportingService2005 Methods&lt;/a&gt;, you will find the two main functions that you will be using mainly. They are the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.reportingservice2005.createdatasource.aspx"&gt;CreateDataSource&lt;/a&gt; function, and the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.reportingservice2005.createreport.aspx"&gt;CreateReport&lt;/a&gt; function.  &lt;p&gt;A brief description of how to use the article or code. The class names, the methods and properties, any tricks or tips.  &lt;p&gt;This is the part which Creates the DataSource &lt;/p&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;pre lang="C#"&gt;public void CreateReportDataSource(string name, string extension, string connectionString)&lt;br /&gt;{&lt;br /&gt;listView1.Items.Add("Creating Data Source [" + txt_DataSource.Text + "]");&lt;br /&gt;ReportService.DataSourceDefinition definition = new ReportServerInstaller.ReportService.DataSourceDefinition();&lt;br /&gt;definition.CredentialRetrieval = ReportService.CredentialRetrievalEnum.Integrated;&lt;br /&gt;definition.ConnectString = connectionString;&lt;br /&gt;definition.Enabled = true;&lt;br /&gt;definition.Extension = extension;&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;rs.CreateDataSource(name, FolderName, chk_DataSourceOverwrite.Checked, definition, null);&lt;br /&gt;listView1.Items.Add("Data source: [" + name + "] created successfully.");&lt;br /&gt;TS_Progress.PerformStep();&lt;br /&gt;}&lt;br /&gt;catch (Exception ex)&lt;br /&gt;{&lt;br /&gt;listView1.Items.Add("ERROR creating data source: " + name);&lt;br /&gt;throw ex;&lt;br /&gt;}&lt;br /&gt;} &lt;/pre&gt;&lt;p&gt;And here is the part which Publishes the report&lt;/p&gt;&lt;pre lang="C#"&gt;private void PublishReport(string reportName)&lt;br /&gt;{&lt;br /&gt;listView1.Items.Add("Publishing Report [" + reportName + "]");&lt;br /&gt;FileStream stream = File.OpenRead(ReportSource);&lt;br /&gt;definition = new byte[stream.Length];&lt;br /&gt;stream.Read(definition, 0, int.Parse(stream.Length.ToString()));&lt;br /&gt;stream.Close();&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;rs.CreateReport(txt_ReportName.Text, FolderName, chk_ReportOverwrite.Checked, definition, null);&lt;br /&gt;listView1.Items.Add("Report: [" + reportName + "] created successfully.");&lt;br /&gt;TS_Progress.PerformStep();&lt;br /&gt;}&lt;br /&gt;catch (Exception ex)&lt;br /&gt;{&lt;br /&gt;listView1.Items.Add("ERROR creating Report: " + reportName);&lt;br /&gt;throw ex;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;I have attached an installer for easy use of the tool. You don't have to configure anything before use. Just insure that you have the correct SQL Manager URL typed in the first form, as this does everything. Happy Deployment! ;) &lt;p&gt;&lt;a href="http://www.mediafire.com/?kmnnepmzedr" target="_blank"&gt;Download Source Code&lt;/a&gt;&lt;a href="http://www.mediafire.com/?tgxgwm5y1cx" target="_blank"&gt;Download Demo&lt;/a&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-602195713851506805?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/602195713851506805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2008/05/simple-gui-tool-for-sql-2005-reports.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/602195713851506805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/602195713851506805'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2008/05/simple-gui-tool-for-sql-2005-reports.html' title='A Simple GUI Tool for SQL 2005 Reports deployment without using BI Development Studio'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-2342230505655072492</id><published>2008-04-03T19:14:00.003+02:00</published><updated>2009-11-21T02:34:23.468+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Content Type'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS'/><title type='text'>How To: Create Custom Pages with Custom Content Type</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Hi again :)&lt;/p&gt;&lt;p&gt;Those are a simple steps to create your Custom Content Type, then create Pages based on that Content Type.&lt;/p&gt;&lt;/blockquote&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;h3&gt;&lt;u&gt;Create Content Type&lt;/u&gt; &lt;/h3&gt;&lt;h4&gt;Steps:&lt;/h4&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Site Actions &amp;gt; Site Settings &amp;gt; Modify All Site Settings&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;p&gt;� Under 'Galleries' &amp;gt; 'Site content types'.  &lt;p&gt;� In 'Site Content Type Gallery' page; Click 'Create'.  &lt;p&gt;� Enter 'NewsContentType' in the 'Name' field.  &lt;p&gt;� Select 'Page Layout Content Type' for the 'Parent Content Type'.  &lt;p&gt;� In the 'Put this site content type into' section; select 'New group' -that's for better organization- and enter a name 'MY Content Types' for that group. &lt;/p&gt;&lt;/blockquote&gt;&lt;h2&gt;&amp;nbsp;&lt;/h2&gt;&lt;h3&gt;&lt;u&gt;Create Columns for your Content Type &lt;/u&gt;&lt;/h3&gt;&lt;h4&gt;Steps:&lt;/h4&gt;&lt;blockquote&gt;&lt;p&gt;� In 'Site Content Type: NewsContentType' page; under 'Columns' section; click 'Add from new site column'.  &lt;p&gt;� For each of the following fields enter 'Column name', select the 'The type of information in this column', and specify the group of that column.  &lt;p&gt;� The fields are: Title 'Single line of text', Date 'Date and Time', Source 'Single line of text', Brief 'Multiple lines of text', Description 'Multiple lines of text', and Image 'Image with formatting and constraints for publishing'. &lt;/p&gt;&lt;/blockquote&gt;&lt;h2&gt;&amp;nbsp;&lt;/h2&gt;&lt;h3&gt;&lt;u&gt;Create Page Layout &lt;/u&gt;&lt;/h3&gt;&lt;h4&gt;Steps:&lt;/h4&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Open your site by SharePoint Designer&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;� File &amp;gt; New &amp;gt; 'SharePoint Content' tab &amp;gt; 'SharePoint Publishing' Section'  &lt;p&gt;� Select 'Page Layout' from the list  &lt;p&gt;� Under 'Options'; Select your Content Group, select your Content Type, Specify URL name, and Title.  &lt;p&gt;� Now in your page layout, you can add fields from your existing Content Type:  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; o Toolbox &amp;gt; SharePoint Contents &amp;gt; 'Your Content Type'.  &lt;p&gt;� You will find your Page Layout saved under:  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; o Catalogues &amp;gt; Master Page &amp;gt; 'Your Page Layout'  &lt;p&gt;� Before using your Page Layout; you've to:  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; o 'Save' and 'Check In' the page  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; o Approve the Page Layout from 'Master Page Gallery' &lt;/p&gt;&lt;/blockquote&gt;&lt;h2&gt;&amp;nbsp;&lt;/h2&gt;&lt;h3&gt;&lt;u&gt;Add Content Type to your Site &lt;/u&gt;&lt;/h3&gt;&lt;h4&gt;Steps:&lt;/h4&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Site Actions &amp;gt; Site Settings &amp;gt; Modify Pages Library Settings &lt;/strong&gt;&lt;/p&gt;&lt;p&gt;� Under 'Content Types' &amp;gt; 'Add from existing site content types'  &lt;p&gt;� In 'Add Content Types: Pages' page; Select 'MY Content Types' group; then select 'NewsContentType' content type from the list. &lt;/p&gt;&lt;/blockquote&gt;&lt;h4&gt;&amp;nbsp;&lt;/h4&gt;&lt;h3&gt;&lt;u&gt;Create Page based on Content Type&lt;/u&gt; &lt;/h3&gt;&lt;h4&gt;Steps:&lt;/h4&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Site Actions &amp;gt; Create Page&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;� Enter 'Page Title and Description' information.  &lt;p&gt;� Select 'Page Layout' that you just created&lt;/p&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-2342230505655072492?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/2342230505655072492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2008/04/how-to-create-custom-pages-with-custom.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/2342230505655072492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/2342230505655072492'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2008/04/how-to-create-custom-pages-with-custom.html' title='How To: Create Custom Pages with Custom Content Type'/><author><name>eNoOo</name><uri>http://www.blogger.com/profile/17090695360941748223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-3254085973975512470</id><published>2008-04-01T18:14:00.006+02:00</published><updated>2009-11-21T02:10:38.610+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MOSS'/><title type='text'>How to: Get Site Template Name</title><content type='html'>&lt;p&gt;Hi all,&lt;br /&gt;&lt;br /&gt;This is a simple topic, but it's very important to know how to get the SiteTemplate Name.&lt;br /&gt;&lt;/p&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;h4&gt;&lt;u&gt;Steps:&lt;/u&gt;&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;Open &lt;strong&gt;"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML"&lt;/strong&gt; directory (assuming you installed MOSS to this path).&lt;br /&gt;&lt;li&gt;In that directory, there are a number of xml files; Open the one called &lt;strong&gt;"webtempsps.xml"&lt;/strong&gt;&lt;br /&gt;&lt;li&gt;In that file you will see an entry for a &lt;template&gt;with a name attribute; and the default &lt;configuration&gt;for that template has an ID attribute.&lt;br /&gt;&lt;li&gt;You combine the two and you get the Site Template Name.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;h4&gt;&lt;u&gt;Here is an Example to get a Site Template Name:&lt;/u&gt;&lt;/h4&gt;&lt;blockquote&gt;&lt;p&gt;&amp;lt;template id="21" name="SPSPERS" ...&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;configuration id="0" title="SharePoint Portal Server Personal Space" .../&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;/template&amp;gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;p&gt;Template Name: &lt;strong&gt;&lt;em&gt;SPSPERS#0&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Hope it helps :)&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-3254085973975512470?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/3254085973975512470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2008/04/how-to-find-site-template-name.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/3254085973975512470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/3254085973975512470'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2008/04/how-to-find-site-template-name.html' title='How to: Get Site Template Name'/><author><name>eNoOo</name><uri>http://www.blogger.com/profile/17090695360941748223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-5054102480532872753</id><published>2008-01-19T01:32:00.003+02:00</published><updated>2011-08-10T10:44:25.932+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>Free Utility: Web.Config Editor with a great UI</title><content type='html'>&lt;p&gt;If you are like me, you hate hand editing HTML and XML!&amp;nbsp; But unfortunately, as a .NET Developer you often find yourself doing it, and if for no other reason, you have to do it for parts of the Web.Config and Application.Config files. Last night, I was googling for something, and just found this &lt;a href="http://asphere.aspweb.cz/default.aspx" target="_blank"&gt;tool&lt;/a&gt; from &lt;a href="http://asphere.aspweb.cz/default.aspx" target="_blank"&gt;ASPhere&lt;/a&gt; by luck. It's really easy, nice, and looks great :)&lt;/p&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;a href="http://asphere.aspweb.cz/default.aspx" target="_blank"&gt;&lt;img src="http://www.sheltonblog.com/images/FreeUtilityWeb.ConfigEditorwithagreatUI_E4FC/image.png"&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Here you are the URL : &lt;a title="http://asphere.aspweb.cz/default.aspx" href="http://www.asphere.cz/asphere.zip"&gt;http://www.asphere.cz/asphere.zip&lt;/a&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-5054102480532872753?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/5054102480532872753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2008/01/free-utility-webconfig-editor-with.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/5054102480532872753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/5054102480532872753'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2008/01/free-utility-webconfig-editor-with.html' title='Free Utility: Web.Config Editor with a great UI'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-9066304143396460555</id><published>2008-01-17T17:45:00.001+02:00</published><updated>2008-01-17T17:45:45.646+02:00</updated><title type='text'>Configuring Visual Studio to Debug .NET Framework Source Code</title><content type='html'>&lt;p&gt;At last, you can now debug the .NET Framework code, and can have a detailed look at the code, and not just the signatures :)&lt;br&gt;Previously, &lt;a href="http://weblogs.asp.net/scottgu"&gt;Scott Gu&lt;/a&gt; announced in his &lt;a href="http://weblogs.asp.net/scottgu"&gt;Blog&lt;/a&gt; that we will be able to see the Framework code, but no idea how; as it wasn't available to everyone.&lt;br&gt;Luckily, &lt;a href="http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx"&gt;Shawn Burke&lt;/a&gt; finally gave us the exact route to the magic! in this &lt;a href="http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx"&gt;post&lt;/a&gt;. &lt;br&gt;I advice you to read &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-source-code-now-available.aspx"&gt;Scott Gu's post about this new feature&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Happy Programming, and enjoy Microsoft's magic ;)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-9066304143396460555?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/9066304143396460555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2008/01/configuring-visual-studio-to-debug-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/9066304143396460555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/9066304143396460555'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2008/01/configuring-visual-studio-to-debug-net.html' title='Configuring Visual Studio to Debug .NET Framework Source Code'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-6820210529070543429</id><published>2007-12-15T00:47:00.001+02:00</published><updated>2009-11-21T02:12:46.780+02:00</updated><title type='text'>Exposing a BTS orchestration as a WCF service</title><content type='html'>Hey everyone, I've learened recently few new technologies that were just released and so decided to share some of the stuff that was hard to find on the web.&lt;br /&gt;&lt;br /&gt;I'll start with Exposing a BizTalk orchestration as a WCF service, it's really simple but there are some problems that happened along the way.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;1. First publish your orchestration as a WCF service&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_PXYFDk10fNI/R2MI5TsLnsI/AAAAAAAAAA0/YplhlfKy_ZU/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5143964980018388674" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_PXYFDk10fNI/R2MI5TsLnsI/AAAAAAAAAA0/YplhlfKy_ZU/s320/1.JPG" border="0" /&gt;&lt;/a&gt;- open the “BizTalk WCF Service Publishing Wizard”&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_PXYFDk10fNI/R2MI5jsLntI/AAAAAAAAAA8/jene9F7hk3w/s1600-h/2.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5143964984313355986" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_PXYFDk10fNI/R2MI5jsLntI/AAAAAAAAAA8/jene9F7hk3w/s320/2.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_PXYFDk10fNI/R2MI5jsLnuI/AAAAAAAAABE/mTm57UISHjA/s1600-h/3.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5143964984313356002" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_PXYFDk10fNI/R2MI5jsLnuI/AAAAAAAAABE/mTm57UISHjA/s320/3.JPG" border="0" /&gt;&lt;/a&gt;-Select your Http Binding&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_PXYFDk10fNI/R2MI5zsLnvI/AAAAAAAAABM/AM6oKSCZV3U/s1600-h/4.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5143964988608323314" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_PXYFDk10fNI/R2MI5zsLnvI/AAAAAAAAABM/AM6oKSCZV3U/s320/4.JPG" border="0" /&gt;&lt;/a&gt; -Browse for your BizTalk application&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_PXYFDk10fNI/R2MI5zsLnwI/AAAAAAAAABU/t9H73JKcF1g/s1600-h/5.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5143964988608323330" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_PXYFDk10fNI/R2MI5zsLnwI/AAAAAAAAABU/t9H73JKcF1g/s320/5.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;div align="center"&gt;&lt;img id="BLOGGER_PHOTO_ID_5143967002947985250" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_PXYFDk10fNI/R2MKvDsLn2I/AAAAAAAAACE/CJKPXgH3NFU/s320/6.JPG" border="0" /&gt;&lt;a href="http://3.bp.blogspot.com/_PXYFDk10fNI/R2MKRjsLnxI/AAAAAAAAABc/Iq7LO5nm1V0/s1600-h/6.JPG"&gt;&lt;/a&gt; -Browse for your BTS application dll.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_PXYFDk10fNI/R2MLITsLn3I/AAAAAAAAACM/ptumdmYg1m4/s1600-h/7.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5143967436739682162" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_PXYFDk10fNI/R2MLITsLn3I/AAAAAAAAACM/ptumdmYg1m4/s320/7.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_PXYFDk10fNI/R2MLITsLn4I/AAAAAAAAACU/vjWACqdoSC8/s1600-h/8.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5143967436739682178" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_PXYFDk10fNI/R2MLITsLn4I/AAAAAAAAACU/vjWACqdoSC8/s320/8.JPG" border="0" /&gt;&lt;/a&gt; -Type the name of your namespace.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_PXYFDk10fNI/R2MLITsLn5I/AAAAAAAAACc/Au4LQ1wmNLo/s1600-h/9.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5143967436739682194" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_PXYFDk10fNI/R2MLITsLn5I/AAAAAAAAACc/Au4LQ1wmNLo/s320/9.JPG" border="0" /&gt;&lt;/a&gt; -Type the name of the Service on the IIS.&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_PXYFDk10fNI/R2MLIjsLn6I/AAAAAAAAACk/ttoyEAavXjE/s1600-h/10.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5143967441034649506" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_PXYFDk10fNI/R2MLIjsLn6I/AAAAAAAAACk/ttoyEAavXjE/s320/10.JPG" border="0" /&gt;&lt;/a&gt; &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="left"&gt;2. After you finish you will have a WCF service created in your IIS. &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="left"&gt;&lt;img id="BLOGGER_PHOTO_ID_5143968995812810674" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_PXYFDk10fNI/R2MMjDsLn7I/AAAAAAAAACs/YEwQMkncmCc/s320/11.JPG" border="0" /&gt;&lt;br /&gt;3. Now you can “Browse” your WCF service normally as any webService.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="left"&gt;4. Consuming your WCF service in a client application:&lt;/div&gt;&lt;br /&gt;&lt;div align="left"&gt;a. Open VS Command Prompt and type: &lt;/div&gt;&lt;div align="left"&gt;“svcutil.exe http://server2003sql:81/WCF_Service/DemoBTS_OrderProcessing_Order_RecievePort.svc?wsdl”&lt;br /&gt;b. This will generate two files at the directory you are on, a configuration file “Output.config”; which contains the endpoint for your WCF service and a code file “BizTalkServiceInstance.cs”; that contains the client class (objects for your receive port and objects for your schemas).&lt;br /&gt;c. Add the two files to your client application and use the generated client class to call the Service.&lt;br /&gt;&lt;br /&gt;5. Submitting data from InfoPath to WCF service:&lt;br /&gt;It’s the same as submitting to WebService, you can find its steps here:&lt;br /&gt;&lt;a href="http://weblog.vb-tech.com/nick/archive/2007/01/17/2100.aspx"&gt;http://weblog.vb-tech.com/nick/archive/2007/01/17/2100.aspx&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="left"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="left"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="left"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="left"&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;PROBLEMS:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="left"&gt;&lt;strong&gt;Problem 1&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div align="left"&gt;&lt;strong&gt;Symptoms:&lt;br /&gt;&lt;/strong&gt;An error occurred while browsing your WCF service from IIS and you can’t view the error.&lt;br /&gt;&lt;strong&gt;Resolution:&lt;/strong&gt;&lt;br /&gt;1. Open the “web.config” file at “C:\Inetpub\wwwroot\WCF_Service”.&lt;br /&gt;2. Uncomment the &lt;customerrors&gt;tag, now you’ll be able to view your error&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="left"&gt;&lt;strong&gt;Problem 2&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p align="left"&gt;The SOAP Adapter fails to register&lt;/p&gt;&lt;img id="BLOGGER_PHOTO_ID_5143976469055905730" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_PXYFDk10fNI/R2MTWDsLn8I/AAAAAAAAAC0/Fp7tpXe24kE/s320/12.JPG" border="0" /&gt;&lt;br /&gt;&lt;p align="left"&gt;&lt;strong&gt;Or&lt;/strong&gt;&lt;br /&gt;The following error may occur when BizTalk Server attempts to register the SOAP (or HTTP) adapter.&lt;br /&gt;"The Messaging Engine failed to register an adapter "SOAP" (Or "HTTP"). Details: "Registering multiple adapter types within the same process is not a supported scenario. For e.g. HTTP and SOAP receive adapters cannot co-exist in the same process".&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Cause:&lt;/strong&gt;&lt;br /&gt;When running BizTalk Server on Windows Server 2003 / IIS 6.x, the SOAP and HTTP adapters cannot execute in the same process space or application pool.&lt;br /&gt;&lt;strong&gt;Resolution:&lt;br /&gt;&lt;/strong&gt;If an installation requires using both the SOAP and HTTP adapters on the same Web server then separate application pools must be created for each adapter. Once created, the virtual directories for each adapter are each assigned to a different application pool.&lt;/p&gt;&lt;img id="BLOGGER_PHOTO_ID_5143976469055905746" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_PXYFDk10fNI/R2MTWDsLn9I/AAAAAAAAAC8/mcMfselNa3Q/s320/13.JPG" border="0" /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="left"&gt;&lt;strong&gt;Problem 3&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img id="BLOGGER_PHOTO_ID_5143976473350873058" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_PXYFDk10fNI/R2MTWTsLn-I/AAAAAAAAADE/hWWBKL_uc4w/s320/14.JPG" border="0" /&gt;&lt;br /&gt;&lt;p align="left"&gt;&lt;strong&gt;Cause&lt;/strong&gt;&lt;br /&gt;You forgot to assign the receive port of the orchestration to the generated receive port of the WCF service.&lt;br /&gt;&lt;strong&gt;Resolution&lt;/strong&gt;&lt;br /&gt;In the “BizTalk Server Administration” Tool &gt;&gt; Orchestration properties &gt;&gt; Bindings&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_PXYFDk10fNI/R2MTWTsLn_I/AAAAAAAAADM/sge0EZqt-j0/s1600-h/15.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5143976473350873074" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_PXYFDk10fNI/R2MTWTsLn_I/AAAAAAAAADM/sge0EZqt-j0/s320/15.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-6820210529070543429?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/6820210529070543429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2007/12/exposing-bts-orchestration-as-wcf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/6820210529070543429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/6820210529070543429'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2007/12/exposing-bts-orchestration-as-wcf.html' title='Exposing a BTS orchestration as a WCF service'/><author><name>eNoOo</name><uri>http://www.blogger.com/profile/17090695360941748223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_PXYFDk10fNI/R2MI5TsLnsI/AAAAAAAAAA0/YplhlfKy_ZU/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-7007275088198550812</id><published>2007-12-13T23:17:00.001+02:00</published><updated>2009-11-21T02:13:50.483+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Code Snippets - Get the most out of them</title><content type='html'>&lt;p&gt;Microsoft finally decided to help us remember some code using the code snippets, that was a new technique since Visual Studio 2005. Visual Studio 2005 came up with some built in code snippets too that I personally didn't find them as much useful as expected. However, later in October 2006, they produced a very nice and vast set of C# code snippets that you can download to integrate those already installed with Visual Studio 2005.&lt;br /&gt;You can download it from this link: &lt;a title="http://go.microsoft.com/fwlink/?linkid=" href="http://go.microsoft.com/fwlink/?linkid=57395&amp;amp;clcid=0x409" clcid="0x409"&gt;http://go.microsoft.com/fwlink/?linkid=57395&amp;amp;clcid=0x409&lt;/a&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;As you can see below, these snippets have a wide range of functionality that we need in our daily programming activities. You no longer have to know how to Read Data from a Serial port or even compute the hashcode of a password. It's really a great one from Microsoft.&lt;/p&gt;&lt;p&gt;&lt;img src="http://i6.tinypic.com/89kd8iu.gif" /&gt; &lt;/p&gt;&lt;h3&gt;How to Add them?&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Well, first of all install the msi file that you downloaded from the URL above&lt;br /&gt;&lt;/li&gt;&lt;li&gt;From the Visual Studio menu, choose Tools &amp;gt; Code Snippets Manager.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i4.tinypic.com/6lwrbsi.gif" /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Press the Add button from the dialog box that will appear&lt;br /&gt;&lt;br /&gt;&lt;img style="MARGIN: 0px" src="http://i2.tinypic.com/6xjqfj6.gif" /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;When installing the code snippets package, it will copy all the snippets to My Documents\MSDN\Visual C# 2005 Code Snippets.&lt;br /&gt;so add this URL in the Browse dialog and press open.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i16.tinypic.com/7xo4uow.gif" /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Here you are, and you are done. Right click, Insert Snippet, and you will find the new Visual C# code Snippets appear. &lt;/p&gt;&lt;p&gt;&lt;img src="http://i8.tinypic.com/8ekp9c1.gif" /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Enjoy and Happy Programming ;)&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-7007275088198550812?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/7007275088198550812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2007/12/code-snippets-get-most-out-of-them.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/7007275088198550812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/7007275088198550812'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2007/12/code-snippets-get-most-out-of-them.html' title='Code Snippets - Get the most out of them'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://i6.tinypic.com/89kd8iu_th.gif' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-1188316782794050989</id><published>2007-12-09T19:47:00.002+02:00</published><updated>2009-11-21T02:14:25.912+02:00</updated><title type='text'>Make Pasting into Visual Studio Easier</title><content type='html'>&lt;p&gt;Don't be limited to plain text. You can paste strings into Visual Studio as comments, string, StringBuilders, and more.&lt;/p&gt;&lt;p&gt;&lt;a name="visualstudiohks-CHP-2-ITERM-2260"&gt;&lt;/a&gt;SmartPaster is a plug-in for Visual Studio .NET 2003 that allows text on the clipboard to be pasted in a format compatible with C# and Visual Basic code. &lt;a name="visualstudiohks-CHP-2-ITERM-2261"&gt;&lt;/a&gt;SmartPaster can be downloaded from &lt;a href="http://www.papadimoulis.com/alex/SmartPaster1.1.zip"&gt;http://www.papadimoulis.com/alex/SmartPaster1.1.zip&lt;/a&gt;.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt; After downloading and installing SmartPaster, you will see a new item on the right-click (context) menu&lt;/p&gt;&lt;p align="center"&gt;&lt;img src="http://img509.imageshack.us/img509/6622/smartpasterjo8.gif" /&gt; &lt;/p&gt;&lt;h4&gt;Paste as String/StringBuilder&lt;/h4&gt;&lt;p&gt;I &lt;a name="visualstudiohks-CHP-2-ITERM-2262"&gt;&lt;/a&gt;&lt;a name="visualstudiohks-CHP-2-ITERM-2263"&gt;&lt;/a&gt;&lt;a name="visualstudiohks-CHP-2-ITERM-2264"&gt;&lt;/a&gt;&lt;a name="visualstudiohks-CHP-2-ITERM-2265"&gt;&lt;/a&gt;find myself most frequently pasting text as a string or a StringBuilder. You can copy any sort of text from another application, then when you paste that text into Visual Studio, you can choose to paste it as a string or as a StringBuilder.&lt;/p&gt;&lt;p&gt;Many developers like to build a &lt;a name="visualstudiohks-CHP-2-ITERM-2266"&gt;&lt;/a&gt;&lt;a name="visualstudiohks-CHP-2-ITERM-2267"&gt;&lt;/a&gt;SQL statement using a tool such as Query Analyzer, for easy testing and debugging, or Microsoft Access, for quick, visual development. As simple as it is to build queries externally, putting them into code can often be a challenge, especially when the queries span multiple lines. SmartPaster eases the task of bringing external queries to code: simply copy your query to the clipboard and paste as a string or StringBuilder. For example, if you copied the following SQL to your clipboard:&lt;/p&gt;&lt;pre&gt;SET ROWCOUNT 10&lt;br /&gt;&lt;br /&gt;SELECT ProductName&lt;br /&gt;&lt;br /&gt;FROM Products&lt;br /&gt;&lt;br /&gt;ORDER BY Products.UnitPrice DESC&lt;/pre&gt;&lt;p&gt;then paste the code into Visual Studio using Paste As String, you would see the following code:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;@"SET ROWCOUNT 10" + Environment.NewLine +&lt;br /&gt;&lt;br /&gt;@"SELECT ProductName" + Environment.NewLine +&lt;br /&gt;&lt;br /&gt;@"FROM Products" + Environment.NewLine +&lt;br /&gt;&lt;br /&gt;@"ORDER BY Products.UnitPrice DESC" + Environment.NewLine +&lt;br /&gt;&lt;br /&gt;@""&lt;/pre&gt;&lt;p&gt;You could also paste this code using Paste As StringBuilder and specify a StringBuilder name of "sqlBuilder," and this would result in the following code:&lt;/p&gt;&lt;pre&gt;StringBuilder sqlBuilder = new StringBuilder(141);&lt;br /&gt;&lt;br /&gt;sqlBuilder.AppendFormat(@"SET ROWCOUNT 10{0}", Environment.NewLine);&lt;br /&gt;&lt;br /&gt;sqlBuilder.AppendFormat(@"SELECT ProductName{0}", Environment.NewLine);&lt;br /&gt;&lt;br /&gt;sqlBuilder.AppendFormat(@"FROM Products{0}", Environment.NewLine);&lt;br /&gt;&lt;br /&gt;sqlBuilder.AppendFormat(@"ORDER BY Products.UnitPrice DESC");&lt;/pre&gt;&lt;p&gt;Like SQL statements, text displayed to the user is often developed externally, either by a copywriter, business analyst, or coder (such as myself), and requires the spellchecker within Microsoft Word. Usually, pasting such code would require going character by character, escaping quotes, and manually adding in line breaks. With SmartPaster, a quick right-click, paste-as, and your external copy is now internal without any of the normal hassle.&lt;/p&gt;&lt;p&gt;In an ideal world, all messages and dialogs would be stored in an external resource file and all SQL statements would be in views and stored procedures. But in a world of deadlines and disposable microapplications, doing it the right way is often trumped by "make sure it works."&lt;/p&gt;&lt;p&gt;As we've seen, SmartPaster offers the option of pasting your text as a string or a StringBuilder. While the difference may seem cosmetic, there are actually appropriate times to use one over the other. The reasoning behind this is that&lt;a name="visualstudiohks-CHP-2-ITERM-2268"&gt;&lt;/a&gt; string literals (i.e., strings explicitly declared in your code, as opposed to those input by the user) are immutable. This means that every operation on a string, such as a concatenation or replacement, involves creating an in-memory buffer, performing the operation, creating a new string, and finally passing the old one to garbage collection.&lt;br /&gt;&lt;br /&gt;Knowing that, it's fairly easy to decide whether to use a string or a StringBuilder. If the text will always be static, such as a tool tip, there will be no advantage to using a StringBuilder (even if string literals are concatenated across lines, the compiler joins them in memory). However, if the text will vary on conditions, such as a runtime error message, then there will definitely be a performance hit using a string as opposed to a StringBuilder.&lt;/p&gt;&lt;p&gt;&lt;a name="visualstudiohks-CHP-2-SECT-3.2"&gt;&lt;/a&gt;&lt;/p&gt;&lt;h4&gt;Paste as Comment&lt;/h4&gt;&lt;p&gt;&lt;a name="visualstudiohks-CHP-2-ITERM-2269"&gt;&lt;/a&gt;&lt;a name="visualstudiohks-CHP-2-ITERM-2270"&gt;&lt;/a&gt;&lt;a name="visualstudiohks-CHP-2-ITERM-2271"&gt;&lt;/a&gt;Just as with strings, any text on the clipboard may be pasted as a block of comments. I've found this very helpful in many cases. Having instant blocks of comments makes development much easier because of the following reasons:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Business rule requirements may be pasted directly into the code for easier translation and to explain what is being done.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Documentation from MSDN or other sources may be pasted in, avoiding the need to switch between the code and a browser window.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;When upgrading code from another platform, the legacy code can be pasted as a comment, making it easier to ensure the logic is the same.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;To paste text as a comment, you simply need to copy text to your clipboard and then choose Paste As Comment. For example, if you copied the following piece of text to your clipboard:&lt;/p&gt;&lt;pre&gt;Call the test method to walk through this scenario and test every part.&lt;/pre&gt;&lt;p&gt;and then pasted it into your document using Paste As Comment, you would see the following comment added:&lt;/p&gt;&lt;pre&gt;//Call the test method to walk through this scenario and test every part.&lt;/pre&gt;&lt;h4&gt;Paste as Region&lt;/h4&gt;&lt;p&gt;When &lt;a name="visualstudiohks-CHP-2-ITERM-2272"&gt;&lt;/a&gt;&lt;a name="visualstudiohks-CHP-2-ITERM-2273"&gt;&lt;/a&gt;pasting as a region, the clipboard text will simply appear between &lt;tt&gt;#region&lt;/tt&gt; and &lt;tt&gt;#endregion&lt;/tt&gt; tags with a region name of your choice. This feature is often helpful when organizing code within your application or pasting regions of code developed by someone else.&lt;/p&gt;&lt;p&gt;First, copy a piece of code like this one to your clipboard:&lt;/p&gt;&lt;pre&gt;private void DoSomething( )&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;//Write Code Here&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Then select Paste As Region, and a small dialog will appear. &lt;/p&gt;&lt;p&gt;From this dialog, you specify the name of the region that you want to use; after you click OK, this code will be pasted into your document:&lt;/p&gt;&lt;pre&gt;#region DoSomething Method&lt;br /&gt;&lt;br /&gt;private void DoSomething( )&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;//Write Code Here&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#endregion&lt;/pre&gt;&lt;h4&gt;Configuration&lt;/h4&gt;&lt;p&gt;&lt;a name="visualstudiohks-CHP-2-ITERM-2274"&gt;&lt;/a&gt;&lt;a name="visualstudiohks-CHP-2-ITERM-2275"&gt;&lt;/a&gt;SmartPaster offers a number of configuration options to make the add-in work best for you. The SmartPaster configuration can be accessed through Paste As Configure.&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-1188316782794050989?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/1188316782794050989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2007/12/make-pasting-into-visual-studio-easier.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/1188316782794050989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/1188316782794050989'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2007/12/make-pasting-into-visual-studio-easier.html' title='Make Pasting into Visual Studio Easier'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-2406776547574255986</id><published>2007-10-03T15:50:00.002+02:00</published><updated>2009-11-21T02:14:57.112+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 2.0'/><title type='text'>Force English DateTime format in Web Pages.</title><content type='html'>&lt;p&gt;Many people argued that i usually add very lengthy posts here in my technical blog, which they think nobody will do read them. But actually, i am targetting in my posts those who are just beginners as well. So I will try my best to minimize everything as much as possible to be OK with everyone, and everybody is welcommed to ask as many questions as he/she wish and I will be answering them as soon as possible :).&lt;/p&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;p&gt;Well this problem I will be mentioning now soon is very common especially for those who live in Arabic countries, as usually they configure their windows in the Regional and language settings to Arabic - [Country].&lt;/p&gt;&lt;h5&gt;What's The problem?&lt;/h5&gt;&lt;p&gt;The problem is that when you get to say&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;DateTime.Now.ToString();&lt;br /&gt;//Value -&amp;gt; 30/01/2006 10:33:00 م&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;As it's obvious, you may find instead of the AM and PM added at the end of the time, it became ص and م instead. The problem may further extend and sometimes you may find the monthe name became فبراير instead of February.&lt;br /&gt;ok so what's the problem? well, if you have a field in the Database that is of DataType DateTime, and tried to insert any of the values mentioned above, you will get an error that says that the string is not a valid DateTime string.&lt;/p&gt;&lt;h5&gt;How to Fix that?&lt;/h5&gt;&lt;p&gt;The first thing that will come in your mind am sure, is to change the Regional and language settings in your windows configuration (Control Panel&amp;gt; Regional and language settings), and make everything point to United States.&lt;/p&gt;&lt;p&gt;&lt;img src="http://img524.imageshack.us/img524/5466/regionalsettingscf2.gif" /&gt; &lt;/p&gt;&lt;p&gt;This is not always the case, and wont always fix your problem. So here you are the clue. In your web Application, edit you web.config file if already available, or add it into your application, and add the following line in it.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#333333;"&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&amp;lt;globalization requestEncoding="utf-8" responseEncoding="utf-8" uiCulture="en" culture="en-US" /&amp;gt;&lt;br /&gt;&lt;/span&gt;     &amp;lt;/system.web&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#333333;"&gt;This forces the website to use the English Culture and the United States Configurations, not just in time formats, but in numbers, currencies, short and long dates. And this sure solves the problem perfectly.&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-2406776547574255986?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/2406776547574255986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2007/10/force-english-datetime-format-in-web.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/2406776547574255986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/2406776547574255986'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2007/10/force-english-datetime-format-in-web.html' title='Force English DateTime format in Web Pages.'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-2850959149270235163</id><published>2007-06-21T22:13:00.001+02:00</published><updated>2007-10-04T12:04:01.576+02:00</updated><title type='text'>WPF Forms  &lt;---&gt;   Win32 Forms</title><content type='html'>&lt;p&gt;As WPF becomes more and more popular nowadays, many people face the problem where they want to embed WPF pages in ordinary pages made in ordinary Win32 pages. Many reasons are there which make developers forced to think about it. Developers want to benefit from the extraordinary WPF benefits such as the flexible and amazing graphical user interface, ..etc. However, WPF can't do everything, as you can't for example create an extensibility project using WPF, you are still forced to use Win32 forms. &lt;/p&gt;&lt;p&gt;However, sometimes developers prefer using Win32 controls, because simply they are more than WPF controls. So here comes the need to embed Win32 forms in WPF forms.&lt;/p&gt;&lt;p&gt;These two walkthroughs are a very good reference for doing so, Thanks to MSDN&lt;/p&gt;&lt;p&gt;&lt;a title="Hosting a Windows Presentation Foundation Control in Windows Forms" href="http://msdn2.microsoft.com/en-us/library/ms742215.aspx" target="_blank"&gt;Walkthrough: Hosting a Windows Presentation Foundation Control in Windows Forms&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a title="Hosting a Windows Forms Control in a Windows Presentation Foundation Page" href="http://msdn2.microsoft.com/en-us/library/ms771575.aspx"&gt;Walkthrough: Hosting a Windows Forms Control in a Windows Presentation Foundation Page&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-2850959149270235163?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/2850959149270235163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2007/06/wpf-forms-win32-forms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/2850959149270235163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/2850959149270235163'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2007/06/wpf-forms-win32-forms.html' title='WPF Forms  &amp;lt;---&amp;gt;   Win32 Forms'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-5982995419011267477</id><published>2007-05-20T15:07:00.002+02:00</published><updated>2009-11-21T02:16:08.352+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMI'/><title type='text'>Retrieving your Computer Information using WMI</title><content type='html'>&lt;div align="left"&gt;&lt;/div&gt;&lt;div align="left"&gt;Hey I am back again with a new post. Many people wonder how can I write a simple application that can tell me everything about my computer, my OS version, detect if I have a printer or not, ....... etc&lt;/div&gt;&lt;div align="left"&gt;Well, we will be using the WMI, Windows Management Windows Management Instrumentation. I believe the best way to discuss this topic is by observing the code directly as it is really simple to read and understand. Please feel free if you have any questions or comments to post them :)&lt;/div&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;div align="left"&gt;Happy coding...&lt;/div&gt;&lt;center&gt; &lt;/center&gt;&lt;center&gt;&lt;img src="http://img248.imageshack.us/img248/8282/consolevp6.jpg" /&gt; &lt;/center&gt;&lt;center&gt; &lt;/center&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Management; &lt;/span&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;namespace WMI&lt;br /&gt;{&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;//&lt;br /&gt;// TODO: Add code to start application here&lt;br /&gt;//&lt;br /&gt;Console.WriteLine("Computer details retrieved using Windows Management Instrumentation (WMI)");&lt;br /&gt;Console.WriteLine("Written By Ahmed IG - ahmedsayed_86@hotmail.com");&lt;br /&gt;Console.WriteLine("=========================================================================");&lt;br /&gt;ManagementObjectSearcher query1 = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem");&lt;br /&gt;ManagementObjectCollection queryCollection1 = query1.Get();&lt;br /&gt;foreach (ManagementObject mo in queryCollection1)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine("Name : " + mo["name"].ToString());&lt;br /&gt;Console.WriteLine("Version : " + mo["version"].ToString());&lt;br /&gt;Console.WriteLine("Manufacturer : " + mo["Manufacturer"].ToString());&lt;br /&gt;Console.WriteLine("Computer Name : " + mo["csname"].ToString());&lt;br /&gt;Console.WriteLine("Windows Directory : " + mo["WindowsDirectory"].ToString());&lt;br /&gt;} &lt;/span&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;query1 = new ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem");&lt;br /&gt;queryCollection1 = query1.Get();&lt;br /&gt;foreach (ManagementObject mo in queryCollection1)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine("Manufacturer : " + mo["manufacturer"].ToString());&lt;br /&gt;Console.WriteLine("Model : " + mo["model"].ToString());&lt;br /&gt;Console.WriteLine(mo["systemtype"].ToString());&lt;br /&gt;Console.WriteLine("Total Physical Memory : " + mo["totalphysicalmemory"].ToString());&lt;br /&gt;} &lt;/span&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;query1 = new ManagementObjectSearcher("SELECT * FROM Win32_processor");&lt;br /&gt;queryCollection1 = query1.Get();&lt;br /&gt;foreach (ManagementObject mo in queryCollection1)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(mo["caption"].ToString());&lt;br /&gt;} &lt;/span&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;query1 = new ManagementObjectSearcher("SELECT * FROM Win32_bios");&lt;br /&gt;queryCollection1 = query1.Get();&lt;br /&gt;foreach (ManagementObject mo in queryCollection1)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(mo["version"].ToString());&lt;br /&gt;} &lt;/span&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;query1 = new ManagementObjectSearcher("SELECT * FROM Win32_timezone");&lt;br /&gt;queryCollection1 = query1.Get();&lt;br /&gt;foreach (ManagementObject mo in queryCollection1)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(mo["caption"].ToString());&lt;br /&gt;} &lt;/span&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;A good refrence about the available Win32 classes, please visit &lt;a title="http://msdn2.microsoft.com/en-us/library/aa394084.aspx" href="http://msdn2.microsoft.com/en-us/library/aa394084.aspx"&gt;http://msdn2.microsoft.com/en-us/library/aa394084.aspx&lt;/a&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-5982995419011267477?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/5982995419011267477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2007/05/getting-computer-information-using-wmi.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/5982995419011267477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/5982995419011267477'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2007/05/getting-computer-information-using-wmi.html' title='Retrieving your Computer Information using WMI'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-3484925142781512002</id><published>2007-04-09T15:13:00.002+02:00</published><updated>2009-11-21T02:16:50.449+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Master Pages'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 2.0'/><title type='text'>Designing MasterPages</title><content type='html'>&lt;p&gt;MasterPages, What are they? Lets first Imagine the case where you have to build a website. Of course, the design must be the same across all the pages, so what you will find yourself doing is, you will be copying the HTML code of the design in all pages, I.e. duplicate work! so what's the alternative way? MasterPages!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;MasterPages allow you to create a consistent layout for the pages in your application. A single master page defines the look and feel and standard behavior that you want for all of the pages (or a group of pages) in your application. You can then create individual content pages that contain the content you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page. Sounds Cool right?&lt;br /&gt;&lt;/p&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;p&gt;For more information about how MasterPages work, please visit this link &lt;a title="http://msdn2.microsoft.com/en-us/library/wtxbf3hh.aspx" href="http://msdn2.microsoft.com/en-us/library/wtxbf3hh.aspx"&gt;http://msdn2.Microsoft.com/en-us/library/wtxbf3hh.aspx&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;But, my aim in this post was not just introducing you to masterpages. I wanted to discuss the way of designing these masterpages because I faced a lot of trouble and problems when I just got started.&lt;/p&gt;&lt;p&gt;Professional designers use special tools like Adobe Image Ready to create nice designs, and cut the pics into boxes and tables. The Adobe Image Ready then can create an HTML page with a table and adjusting everything, images, background images, background colors,........etc. So what will you be doing is just replacing the masterpage HTML code with that you have in the HTML code you got from the Adobe Image Ready where it has all the code for all the content you made in your nice design. But please don't forget to add the following tags in the body section of the HTML code, and placing everything inside it.&lt;/p&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#333333;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;form&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;="form1"&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;runat&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&amp;lt;/&lt;span style="color:#804040;"&gt;form&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;The reason for this tag is of course known, as if you didn't add these tags, and tried to put any server control in the page, these controls will throw an exception, saying "Control must be placed inside a form tag with runat="server"".&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;Here we come to the real problem where most of people suffer from. Lets see the case were we have a masterpage (Masterpage.master) and a content page (Default.aspx), where they are in the same directory&lt;/span&gt;&lt;/p&gt;&lt;img id="BLOGGER_PHOTO_ID_5051416173021450754" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_9eoDpEQOERU/Rho8Pu2bUgI/AAAAAAAAAAM/V20eVHjdKlg/s320/samelevel.JPG" border="0" /&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;/p&gt;&lt;p align="left"&gt;Everything will go really simple, cute and so smooth. No problems at all. in your content page (Default.aspx) you will find everything you placed in the masterpage. Lets first see the other situation and where the problem appears, then we will get to know what is the reason and how to solve it.&lt;/p&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5051416782906806802" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_9eoDpEQOERU/Rho8zO2bUhI/AAAAAAAAAAU/O_hsOEBaySQ/s320/diffdirectory.JPG" border="0" /&gt;&lt;br /&gt;&lt;p align="left"&gt;In this case, the content page (ForgotPassword.aspx) is in another subdirectory of that where we placed our masterpage. what you will usually find is that not everything you placed in the masterpage appears in your page, background images disappeared, images aren't there, and a red X mark appears instead. The only thing that acts normally is the background color.&lt;/p&gt;&lt;p align="left"&gt;At runtime, the master page and the content page are in the same control hierarchy – the master page is essentially a user control inside the content page. At design time, however, the master page and content page are two different entities. In fact, the master page and content page may live in different directories. During design time, it's easy to put URLs and relative paths into our master pages, but we have to be careful when using relative paths. Take the following master page excerpt as an example:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&amp;lt;div&amp;gt;&lt;br /&gt;&lt;strong&gt;&amp;lt;img src="logo.gif" alt="Company Logo" &lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;/&amp;gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&amp;lt;asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;/asp:ContentPlaceHolder&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;As long as the master page and the web form live in the &lt;em&gt;same directory&lt;/em&gt;, the company logo will display in the browser. When the master page and web form live in &lt;em&gt;different directories&lt;/em&gt;, the image will &lt;strong&gt;not&lt;/strong&gt; appear. The browser requests knows nothing about master pages. The browser will interpret any relative paths it finds in the HTML as being relative to the webform. If our logo and master page files are in the root directory, but the web form is in a subdirectory, the browser will ask for logo.gif from the same subdirectory. The server will respond with a 404 (file not found) error.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The good news is, the ASP.NET runtime does provide a feature called “URL rebasing”. The runtime will try to “rebase” relative URLs it finds on &lt;b&gt;server-side&lt;/b&gt; controls inside a master page. This means the following relative path will work, no matter where the master page and web form live.&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&amp;lt;img src="logo.gif" alt="Company Logo" &lt;strong&gt;runat="server"&lt;/strong&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;We’ve added a runat=”server” attribute to the image tag, making the &amp;lt;img&amp;gt; a server-side control. When the master page file and logo are in the root directory, but the web form is in a subdirectory, the ASP.NET runtime will rebase the relative path it finds in the src attribute to point to the root of the website.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The following code will also work, because we are using a server-side Image object.&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&amp;lt;asp:Image ImageUrl="logo.gif" runat="server" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Now lets have a look at background images, as we have to act differently with them.&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&amp;lt;body background="logo.gif" runat="server"&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;&amp;lt;!-- the background for the body tag will break --&amp;gt;&lt;br /&gt;&lt;/strong&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;div id="Div1" style="background-image: url('logo.gif');" runat="server"&amp;gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;&amp;lt;!-- My background is also broken. --&amp;gt;&lt;/strong&gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;If you need to use a relative path in an area where the runtime does not provide the rebasing feature, you can compute a client side URL using ResolveClientUrl and passing a relative path. ResolveClientUrl, when called from inside a master page, will take into account the location of the master page, the location specified in the HTTP request, and the location specified by the relative path parameter to formulate the correct relative path to return.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&amp;lt;body background=&amp;lt;%= ResolveClientUrl("logo.gif") %&amp;gt; &amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;When working with image paths in embedded styles, it’s often a good idea to move the style definition into a .css file. The ASP.NET runtime will rebase the path it finds inside a link tag, so we won’t have any problems locating the stylesheet from any webform. Take the following style definition in a .css file:&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;body&lt;br /&gt;{&lt;br /&gt;background-image:url('images\logo.gif');&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Relative paths are safe inside a .css file because the browser will always request logo.gif &lt;i&gt;relative to the location of the stylesheet.&lt;/i&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-3484925142781512002?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/3484925142781512002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2007/04/designing-masterpages.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/3484925142781512002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/3484925142781512002'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2007/04/designing-masterpages.html' title='Designing MasterPages'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_9eoDpEQOERU/Rho8Pu2bUgI/AAAAAAAAAAM/V20eVHjdKlg/s72-c/samelevel.JPG' height='72' width='72'/><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2663297772371016015.post-6947883090007255877</id><published>2007-04-06T05:17:00.000+02:00</published><updated>2007-04-06T15:23:35.972+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hello World'/><title type='text'>My First Post</title><content type='html'>&lt;span style="font-family:georgia;font-size:85%;"&gt;Hey Everybody, Thanks for visiting my Technical Blog first. ISA I will be posting here only technical issues, and maybe some useful posts. Hope everybody can benefit from it. See you soon with my next real TECHNICAL POST.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2663297772371016015-6947883090007255877?l=techietweaks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techietweaks.blogspot.com/feeds/6947883090007255877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techietweaks.blogspot.com/2007/04/my-first-post_06.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/6947883090007255877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2663297772371016015/posts/default/6947883090007255877'/><link rel='alternate' type='text/html' href='http://techietweaks.blogspot.com/2007/04/my-first-post_06.html' title='My First Post'/><author><name>Ahmed IG</name><uri>https://profiles.google.com/108099546966939487570</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-K6R9-J_LOPA/AAAAAAAAAAI/AAAAAAAAANI/A5ANdgscgGc/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry></feed>
