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

<channel>
	<title>Jeff Douglas - Technology, Coding and Bears... OH MY! &#187; .NET</title>
	<atom:link href="http://blog.jeffdouglas.com/category/technology/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jeffdouglas.com</link>
	<description>Get your head out of your #@! and into the clouds!</description>
	<lastBuildDate>Thu, 02 Feb 2012 11:57:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>AWS SDK for .NET</title>
		<link>http://blog.jeffdouglas.com/2009/11/12/aws-sdk-for-net/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=aws-sdk-for-net</link>
		<comments>http://blog.jeffdouglas.com/2009/11/12/aws-sdk-for-net/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 10:44:54 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Amazon EC2]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=1660</guid>
		<description><![CDATA[It looks like Amazon is marching towards IaaS-domination with the release of an SDK for .NET. It&#8217;s interesting that they only support C# and not VB.NET. You would think that since there are more VB developers they could more bang for their buck by offering both languages. Perhaps VB.NET is on the roadmap. &#8220;The AWS [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F11%2F12%2Faws-sdk-for-net%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F11%2F12%2Faws-sdk-for-net%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://blog.jeffdouglas.com/wp-content/uploads/2009/09/logo_aws.gif" rel="lightbox[1660]"><img class="alignleft size-full wp-image-1353" style="padding-right:10px;padding-bottom:5px;" title="logo_aws" src="http://blog.jeffdouglas.com/wp-content/uploads/2009/09/logo_aws.gif" alt="logo_aws" width="164" height="60" /></a>It looks like Amazon is marching towards IaaS-domination with the release of an <a href="http://aws.amazon.com/sdkfornet/" target="_blank">SDK for .NET</a>.</p>
<p>It&#8217;s interesting that they only support C# and not VB.NET. You would think that since there are more VB developers they could more bang for their buck by offering both languages. Perhaps VB.NET is on the roadmap.</p>
<blockquote><p>&#8220;The AWS SDK for .NET makes it even easier for Windows developers to build .NET applications that tap into the cost-effective, scalable, and reliable AWS cloud. Using the SDK, developers will be able to build solutions for AWS infrastructure services, including Amazon Simple Storage Service (Amazon S3), Amazon Elastic Compute Cloud (Amazon EC2), and Amazon SimpleDB. With the AWS SDK for .NET, developers get started in minutes with a single, downloadable package complete with Visual Studio project templates, the AWS .NET library, C# code samples, and documentation.&#8221;</p></blockquote>
<p>The SDK requires <a href="http://msdn.microsoft.com/en-us/netframework/default.aspx">Microsoft .NET Framework</a> 2.0 or later only supports the following editions:</p>
<ol style="padding-left:25px;">
<li>Microsoft Visual Studio 2008 Professional Edition or later</li>
<li>Microsoft Visual C# 2008 Express Edition</li>
<li>Microsoft Visual Web Developer 2008 Express Edition</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2009/11/12/aws-sdk-for-net/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC 1.0 Released &#8212; Finally!</title>
		<link>http://blog.jeffdouglas.com/2009/03/21/aspnet-mvc-10-released/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=aspnet-mvc-10-released</link>
		<comments>http://blog.jeffdouglas.com/2009/03/21/aspnet-mvc-10-released/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 14:16:59 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=629</guid>
		<description><![CDATA[Be still my beating heart&#8230; it&#8217;s finally arrived! No more view states and post backs. It will finally be fun to do .NET web development again. I love C# but hate postbacks and view states! ASP.NET MVC 1.0 Released!]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F03%2F21%2Faspnet-mvc-10-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F03%2F21%2Faspnet-mvc-10-released%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Be still my beating heart&#8230; it&#8217;s finally arrived! No more view states and post backs. It will finally be fun to do .NET web development again. I love C# but <span style="text-decoration:underline;"><strong>hate</strong></span> postbacks and view states!</p>
<p><a href="http://haacked.com/archive/2009/03/18/aspnet-mvc-rtw.aspx" target="_blank">ASP.NET MVC 1.0 Released!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2009/03/21/aspnet-mvc-10-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate a Visualforce Page from an Existing Page Layout</title>
		<link>http://blog.jeffdouglas.com/2009/02/09/generate-a-visualforce-page-from-an-existing-page-layout/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=generate-a-visualforce-page-from-an-existing-page-layout</link>
		<comments>http://blog.jeffdouglas.com/2009/02/09/generate-a-visualforce-page-from-an-existing-page-layout/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 00:56:43 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Salesforce]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=433</guid>
		<description><![CDATA[We have a rather large Org with 600+ Page Layouts. When Visualforce came out we had a number of requests from our business units for customized layouts. After about 3 weeks of hand-coding Visualforce pages I soon realized I needed a better way to communicate these change as well as manage the code modifications. Being [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F02%2F09%2Fgenerate-a-visualforce-page-from-an-existing-page-layout%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F02%2F09%2Fgenerate-a-visualforce-page-from-an-existing-page-layout%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We have a rather large Org with 600+ Page Layouts. When Visualforce came out we had a number of requests from our business units for customized layouts. After about 3 weeks of hand-coding Visualforce pages I soon realized I needed a better way to communicate these change as well as manage the code modifications. Being that I am relatively lazy by nature, I decided that I needed to develop a way to make my computer do the work that I didn&#8217;t want to do.</p>
<p><img class="alignnone size-full wp-image-446" title="Generate Visualforce Pages" src="http://blog.jeffdouglas.com/wp-content/uploads/2009/02/scaffolding.png" alt="Generate Visualforce Pages" width="544" height="561" /></p>
<p>The C# code that I wrote utilizes the Metadata API and inspects the Page Layout for a specified Object and Recordtype and generates similar Visualforce code that you can paste into the Force.com IDE. Is it perfect? No. Could it have been done better? Yes. Does it save me time, money and aggravation? Most certainly!</p>
<p>It also saves me time during the change management process. Now when a BA or Project Manager modifies an existing Page Layout that I have used for a Visualforce page, I don&#8217;t need documentation on what fields have changed, I just point my handy-dandy generator at the Page Layout and regenerate the code.</p>
<p><strong>Default.aspx</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
</pre></td><td class="code"><pre class="asp" style="font-family:monospace;">&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;Default.aspx.cs&quot; Inherits=&quot;Visualforce_Scaffolding._Default&quot; %&gt;
&nbsp;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&nbsp;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head runat=&quot;server&quot;&gt;
	&lt;title&gt;Visualforce Scaffolding Generator&lt;/title&gt;
	&lt;style type=&quot;text/css&quot;&gt;
	.style1
	{
	    height: 25px;
	}
	&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
&lt;div&gt;
&lt;h1&gt;Visualforce Scaffolding Generator&lt;/h1&gt;
&lt;asp:Label ID=&quot;Label3&quot; runat=&quot;server&quot; Text=&quot;This page generates the Visualforce code for a specific object and recordtye. The code inspects the page layout for the recordtype and creates a very similar replica of the sections and field layouts as Visualforce code. You can then take this code and paste it into a Visualforce page with minimal changes.&quot;/&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;
&lt;tr&gt;
&lt;td&gt;&lt;asp:Label ID=&quot;Label1&quot; runat=&quot;server&quot; Text=&quot;Object&quot;&gt;&lt;/asp:Label&gt;&lt;/td&gt;
&lt;td&gt;&lt;asp:TextBox ID=&quot;txtObject&quot; runat=&quot;server&quot; Width=&quot;200px&quot;&gt;Account&lt;/asp:TextBox&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;asp:Label ID=&quot;Label2&quot; runat=&quot;server&quot; Text=&quot;RecordType ID&quot;&gt;&lt;/asp:Label&gt;&lt;/td&gt;
&lt;td&gt;&lt;asp:TextBox ID=&quot;txtRecordTypeId&quot; runat=&quot;server&quot; Width=&quot;200px&quot;&gt;01260000000Dxxx&lt;/asp:TextBox&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;style1&quot;&gt;Page Type&lt;/td&gt;
&lt;td class=&quot;style1&quot;&gt;
				&lt;asp:DropDownList ID=&quot;ddlMode&quot; runat=&quot;server&quot;&gt;
				&lt;asp:ListItem Value=&quot;Edit&quot;&gt;New/Edit&lt;/asp:ListItem&gt;
				&lt;asp:ListItem&gt;Display&lt;/asp:ListItem&gt;
				&lt;/asp:DropDownList&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;asp:Button ID=&quot;Button1&quot; runat=&quot;server&quot; Text=&quot;Generate Code&quot; onclick=&quot;Button1_Click&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;asp:Literal ID=&quot;Code&quot; runat=&quot;server&quot;&gt;&lt;/asp:Literal&gt;
&nbsp;
	&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p><strong>Here is the code behind for Default.aspx.cs</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Visualforce_Scaffolding.sforce;
&nbsp;
namespace Visualforce_Scaffolding
{
    public partial class _Default : System.Web.UI.Page
    {
&nbsp;
        private string username;
        private string password;
        private string sessionId;
        private string serverUrl;
        private SforceService proxy;
&nbsp;
        protected void Page_Load(object sender, EventArgs e)
        {
            proxy = new sforce.SforceService();
            if (Request.QueryString[&quot;sessionId&quot;] != null)
            {
                sessionId = Request.QueryString[&quot;sessionId&quot;].ToString();
                serverUrl = Request.QueryString[&quot;url&quot;].ToString();
            }
            else
            {
                // hardcode the u/p for development
                username = &quot;YOUR_USERNAME&quot;;
                password = &quot;YOUR_PASSWORD&quot;;
            }
        }
&nbsp;
        private void output(string s, int tabs)
        {
            // fix some characters for html output
            s = s.Replace(&quot;&lt;&quot;, &quot;&amp;#60&quot;);
            s = s.Replace(&quot;&gt;&quot;, &quot;&amp;#62&quot;);
&nbsp;
            for (int j = 0; j &lt; tabs; j++)
            {
                Code.Text = Code.Text + (&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;);
                //Response.Write(&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;);
            }
&nbsp;
            Code.Text = Code.Text + (s);
            Code.Text = Code.Text + (&quot;[br]&quot;);
        }
&nbsp;
        public void generateDisplayPageLayout(string objectToDescribe, string recordType)
        {
            output(&quot;&lt;apex:page standardController=\&quot;&quot; + txtObject.Text + &quot;\&quot;&gt;&quot;, 0);
            output(&quot;&lt;apex:sectionHeader title=\&quot;&quot; + txtObject.Text + &quot;\&quot; subtitle=\&quot;{!&quot; + txtObject.Text.ToLower() + &quot;.name}\&quot;/&gt;&quot;, 1);
            output(&quot;&lt;apex:pageBlock title=\&quot;&quot; + txtObject.Text + &quot;\&quot;&gt;&quot;, 1);
&nbsp;
            try
            {
                sforce.DescribeLayoutResult dlr = proxy.describeLayout(objectToDescribe, new string[] { recordType });
&nbsp;
                // get all of the fields that are in this layout
                for (int i = 0; i &lt; dlr.layouts.Length; i++)
                {
                    sforce.DescribeLayout layout = dlr.layouts[i];
                    if (layout.editLayoutSections != null)
                    {
                        for (int j = 0; j &lt; layout.editLayoutSections.Length; j++)
                        {
                            sforce.DescribeLayoutSection els = layout.editLayoutSections[j];
&nbsp;
                            output(&quot;&quot;, 2);
                            output(&quot;&lt;apex:pageBlockSection title=\&quot;&quot; + els.heading + &quot;\&quot; columns=\&quot;&quot; + els.columns + &quot;\&quot;&gt;&quot;, 2);
&nbsp;
                            for (int k = 0; k &lt; els.layoutRows.Length; k++)
                            {
                                sforce.DescribeLayoutRow lr = els.layoutRows[k];
                                for (int h = 0; h &lt; lr.layoutItems.Length; h++)
                                {
                                    sforce.DescribeLayoutItem li = lr.layoutItems[h];
                                    if (li.layoutComponents != null)
                                    {
                                        output(&quot;&lt;apex:outputField title=\&quot;&quot; + li.label + &quot;\&quot; value=\&quot;{!&quot; + txtObject.Text.ToLower() + &quot;.&quot; + li.layoutComponents[0].value + &quot;}\&quot;/&gt;&quot;, 3);
                                        //Response.Write(&quot; &quot; + h + &quot; &quot; + li.layoutComponents[0].value + &quot;(editable: &quot; + li.editable + &quot;) label: &quot; + li.label + &quot; required: &quot; + li.required + &quot;[br]&quot;);
                                    }
&nbsp;
                                }
                            }
&nbsp;
                            output(&quot;&lt;/apex:pageBlockSection&gt;&quot;, 2);
&nbsp;
                        }
                    }
                }
&nbsp;
            }
            catch (Exception e)
            {
                Response.Write(&quot;An exceptions was caught: &quot; + e.Message + &quot;[br]&quot;);
            }
&nbsp;
            output(&quot;&lt;/apex:pageBlock&gt;&quot;, 1);
            output(&quot;&lt;/apex:page&gt;&quot;, 0);
&nbsp;
        }
&nbsp;
        public void generateEditPageLayout(string objectToDescribe, string recordType)
        {
            output(&quot;&lt;apex:page standardController=\&quot;&quot; + txtObject.Text + &quot;\&quot;&gt;&quot;, 0);
            output(&quot;&lt;apex:sectionHeader title=\&quot;&quot; + txtObject.Text + &quot; Edit\&quot; subtitle=\&quot;{!&quot; + txtObject.Text.ToLower() + &quot;.name}\&quot;/&gt;&quot;, 1);
            output(&quot;&lt;apex:form&gt;&quot;, 1);
            output(&quot;&lt;apex:pageBlock title=\&quot;&quot; + txtObject.Text + &quot; Edit\&quot; mode=\&quot;edit\&quot;&gt;&quot;, 1);
&nbsp;
            output(&quot;&quot;, 2);
&nbsp;
            output(&quot;&lt;apex:pageBlockButtons location=\&quot;top\&quot;&gt;&quot;, 2);
            output(&quot;&lt;apex:commandButton value=\&quot;Save\&quot; action=\&quot;{!save}\&quot; /&gt;&quot;, 3);
            output(&quot;&lt;apex:commandButton value=\&quot;Save &amp; New\&quot; action=\&quot;{!save}\&quot; /&gt;&quot;, 3);
            output(&quot;&lt;apex:commandButton value=\&quot;Cancel\&quot; action=\&quot;{!cancel}\&quot; /&gt;&quot;, 3);
            output(&quot;&lt;/apex:pageBlockButtons&gt;&quot;, 2);
&nbsp;
            output(&quot;&lt;apex:pageBlockButtons location=\&quot;bottom\&quot;&gt;&quot;, 2);
            output(&quot;&lt;apex:commandButton value=\&quot;Save\&quot; action=\&quot;{!save}\&quot; /&gt;&quot;, 3);
            output(&quot;&lt;apex:commandButton value=\&quot;Save &amp; New\&quot; action=\&quot;{!save}\&quot; /&gt;&quot;, 3);
            output(&quot;&lt;apex:commandButton value=\&quot;Cancel\&quot; action=\&quot;{!cancel}\&quot; /&gt;&quot;, 3);
            output(&quot;&lt;/apex:pageBlockButtons&gt;&quot;, 2);
&nbsp;
            try
            {
                sforce.DescribeLayoutResult dlr = proxy.describeLayout(objectToDescribe, new string[] { recordType });
&nbsp;
                // get all of the fields that are in this layout
                for (int i = 0; i &lt; dlr.layouts.Length; i++)
                {
                    sforce.DescribeLayout layout = dlr.layouts[i];
                    if (layout.editLayoutSections != null)
                    {
                        for (int j = 0; j &lt; layout.editLayoutSections.Length; j++)
                        {
                            sforce.DescribeLayoutSection els = layout.editLayoutSections[j];
&nbsp;
                            output(&quot;&quot;, 2);
                            output(&quot;&lt;apex:pageBlockSection title=\&quot;&quot; + els.heading + &quot;\&quot; columns=\&quot;&quot; + els.columns + &quot;\&quot;&gt;&quot;, 2);
&nbsp;
                            for (int k = 0; k &lt; els.layoutRows.Length; k++)
                            {
                                sforce.DescribeLayoutRow lr = els.layoutRows[k];
                                for (int h = 0; h &lt; lr.layoutItems.Length; h++)
                                {
                                    sforce.DescribeLayoutItem li = lr.layoutItems[h];
                                    if (li.layoutComponents != null)
                                    {
                                        output(&quot;&lt;apex:inputField value=\&quot;{!&quot; + txtObject.Text.ToLower() + &quot;.&quot; + li.layoutComponents[0].value + &quot;}\&quot; required=\&quot;&quot; + li.required.ToString().ToLower() + &quot;\&quot;/&gt;&quot;, 3);
                                        //Response.Write(&quot; &quot; + h + &quot; &quot; + li.layoutComponents[0].value + &quot;(editable: &quot; + li.editable + &quot;) label: &quot; + li.label + &quot; required: &quot; + li.required + &quot;[br]&quot;);
                                    }
&nbsp;
                                }
                            }
&nbsp;
                            output(&quot;&lt;/apex:pageBlockSection&gt;&quot;, 2);
&nbsp;
                        }
                    }
                }
&nbsp;
            }
            catch (Exception e)
            {
                Response.Write(&quot;An exceptions was caught: &quot; + e.Message + &quot;[br]&quot;);
            }
&nbsp;
            output(&quot;&lt;/apex:pageBlock&gt;&quot;, 1);
            output(&quot;&lt;/apex:form&gt;&quot;, 1);
            output(&quot;&lt;/apex:page&gt;&quot;, 0);
&nbsp;
        }
&nbsp;
        public bool login()
        {
&nbsp;
            // use the existing session from the org
            if (sessionId != null)
            {
&nbsp;
                try
                {
                    Response.Write(&quot;Using existing session[br]&quot;);
                    proxy.Url = serverUrl;
                    proxy.SessionHeaderValue = new sforce.SessionHeader();
                    proxy.SessionHeaderValue.sessionId = sessionId;
&nbsp;
                    GetUserInfoResult userInfo = proxy.getUserInfo();
                    Response.Write(&quot;Logged in as &quot; + userInfo.userFullName + &quot; - &quot; + userInfo.userName + &quot;&lt;hr /&gt;&quot;);
&nbsp;
                }
                catch (Exception ex)
                {
                    Response.Write(&quot;Error logging in with session: &quot; + ex.Message + &quot;[br]&quot;);
                    return false;
                }
&nbsp;
                return true;
&nbsp;
            }
            else
            {
&nbsp;
                // this is for development
                Response.Write(&quot;Logging in with u/p[br]&quot;);
                sforce.LoginResult lr = proxy.login(username, password);
                if (!lr.passwordExpired)
                {
                    // Reset the SOAP endpoint to the returned server URL
                    proxy.Url = lr.serverUrl;
                    // Create a new session header object and add the session ID returned from the login
                    proxy.SessionHeaderValue = new sforce.SessionHeader();
                    proxy.SessionHeaderValue.sessionId = lr.sessionId;
&nbsp;
                    GetUserInfoResult userInfo = lr.userInfo;
                    Response.Write(&quot;Logged in as &quot; + userInfo.userFullName + &quot; - &quot; + userInfo.userName + &quot;&lt;hr /&gt;&quot;);
                }
                else
                {
                    Response.Write(&quot;Your password is expired.[br]&quot;);
                    return false;
                }
                return true;
            }
        }
&nbsp;
        protected void Button1_Click(object sender, EventArgs e)
        {
            Code.Text = &quot;&quot;;
            if (login())
            {
                Code.Text = Code.Text + &quot;&lt;hr /&gt;&quot;;
                if (ddlMode.Text == &quot;Edit&quot;)
                {
                    generateEditPageLayout(txtObject.Text, txtRecordTypeId.Text);
                }
                else
                {
                    generateDisplayPageLayout(txtObject.Text, txtRecordTypeId.Text);
                }
            }
        }
&nbsp;
    }
}</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2009/02/09/generate-a-visualforce-page-from-an-existing-page-layout/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC 1.0 Release Candidate Now Available</title>
		<link>http://blog.jeffdouglas.com/2009/01/28/aspnet-mvc-10-release-candidate-now-available/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=aspnet-mvc-10-release-candidate-now-available</link>
		<comments>http://blog.jeffdouglas.com/2009/01/28/aspnet-mvc-10-release-candidate-now-available/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 15:30:46 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=431</guid>
		<description><![CDATA[The ASP.NET MVC RC is now available and I am so excited that I can hardly stand it! At work we do alot of .NET development but I cannot stand the ViewState and Postback paradigm. I&#8217;m been tinkering around with with ASP.NET MVC for quite awhile and have a couple of prototypes under my belt. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F01%2F28%2Faspnet-mvc-10-release-candidate-now-available%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F01%2F28%2Faspnet-mvc-10-release-candidate-now-available%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The <a href="http://weblogs.asp.net/scottgu/archive/2009/01/27/asp-net-mvc-1-0-release-candidate-now-available.aspx">ASP.NET MVC RC is now available</a> and I am so excited that I can hardly stand it! At work we do alot of .NET development but I cannot stand the ViewState and Postback paradigm. I&#8217;m been tinkering around with with ASP.NET MVC for quite awhile and have a couple of prototypes under my belt. According to the post, the 1.0 version should be released sometime in Febraury.</p>
<p>I&#8217;ve been seeing alot of posts on non-.NET sites with positive feedback. I think ASP.NET MVC may make it easier for Java developers to switch to the &#8220;dark side.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2009/01/28/aspnet-mvc-10-release-candidate-now-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

