<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Default wizard button in ASP.NET</title>
	<atom:link href="http://www.leghumped.com/blog/2009/01/05/default-wizard-button-in-aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.leghumped.com/blog/2009/01/05/default-wizard-button-in-aspnet/</link>
	<description>Coding snippets, tutorials and procrastinations about C#, Java and Linux.</description>
	<lastBuildDate>Mon, 28 Jun 2010 09:06:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Echilon</title>
		<link>http://www.leghumped.com/blog/2009/01/05/default-wizard-button-in-aspnet/comment-page-1/#comment-5358</link>
		<dc:creator>Echilon</dc:creator>
		<pubDate>Mon, 18 May 2009 07:45:23 +0000</pubDate>
		<guid isPermaLink="false">http://leghumped.com/blog/?p=336#comment-5358</guid>
		<description>And the exception is..?</description>
		<content:encoded><![CDATA[<p>And the exception is..?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bahar</title>
		<link>http://www.leghumped.com/blog/2009/01/05/default-wizard-button-in-aspnet/comment-page-1/#comment-5357</link>
		<dc:creator>bahar</dc:creator>
		<pubDate>Mon, 18 May 2009 06:36:40 +0000</pubDate>
		<guid isPermaLink="false">http://leghumped.com/blog/?p=336#comment-5357</guid>
		<description>hi,

I get exception error when using this code in page load function of asp.net C#.
plz let me know what should I do?
my code is exactly:
&lt;pre lang=&quot;csharp&quot;&gt;
*if (!Page.IsPostBack)
        { // First page, nothing clicked
            Master.Page.Form.DefaultButton = Wizard1.FindControl(&quot;StartNavigationTemplateContainerID$StartNextButton&quot;).UniqueID;
        }
        else
        {
            //Wizard1.ActiveStepIndex = 0;
            switch (Wizard1.ActiveStepIndex)
            { // set the default button to next
                case 0: //page has posted back but is still on page one, about to load page 2
                    break;
                
                case 2: // my wizard only had three steps, but this should be the number of steps-1
                    Master.Page.Form.DefaultButton = Wizard1.FindControl(&quot;FinishNavigationTemplateContainerID$FinishButton&quot;).UniqueID;
                    break;

                default:
                    Master.Page.Form.DefaultButton = Wizard1.FindControl(&quot;StepNavigationTemplateContainerID$StepNextButton&quot;).UniqueID;
                    break;

            }
        }
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>I get exception error when using this code in page load function of asp.net C#.<br />
plz let me know what should I do?<br />
my code is exactly:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">*</span><span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">!</span>Page<span style="color: #008000;">.</span><span style="color: #0000FF;">IsPostBack</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span> <span style="color: #008080; font-style: italic;">// First page, nothing clicked</span>
            Master<span style="color: #008000;">.</span><span style="color: #0000FF;">Page</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Form</span><span style="color: #008000;">.</span><span style="color: #0000FF;">DefaultButton</span> <span style="color: #008000;">=</span> Wizard1<span style="color: #008000;">.</span><span style="color: #0000FF;">FindControl</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;StartNavigationTemplateContainerID$StartNextButton&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">UniqueID</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
        <span style="color: #0600FF; font-weight: bold;">else</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #008080; font-style: italic;">//Wizard1.ActiveStepIndex = 0;</span>
            <span style="color: #0600FF; font-weight: bold;">switch</span> <span style="color: #008000;">&#40;</span>Wizard1<span style="color: #008000;">.</span><span style="color: #0000FF;">ActiveStepIndex</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span> <span style="color: #008080; font-style: italic;">// set the default button to next</span>
                <span style="color: #0600FF; font-weight: bold;">case</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">:</span> <span style="color: #008080; font-style: italic;">//page has posted back but is still on page one, about to load page 2</span>
                    <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">case</span> <span style="color: #FF0000;">2</span><span style="color: #008000;">:</span> <span style="color: #008080; font-style: italic;">// my wizard only had three steps, but this should be the number of steps-1</span>
                    Master<span style="color: #008000;">.</span><span style="color: #0000FF;">Page</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Form</span><span style="color: #008000;">.</span><span style="color: #0000FF;">DefaultButton</span> <span style="color: #008000;">=</span> Wizard1<span style="color: #008000;">.</span><span style="color: #0000FF;">FindControl</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;FinishNavigationTemplateContainerID$FinishButton&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">UniqueID</span><span style="color: #008000;">;</span>
                    <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">default</span><span style="color: #008000;">:</span>
                    Master<span style="color: #008000;">.</span><span style="color: #0000FF;">Page</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Form</span><span style="color: #008000;">.</span><span style="color: #0000FF;">DefaultButton</span> <span style="color: #008000;">=</span> Wizard1<span style="color: #008000;">.</span><span style="color: #0000FF;">FindControl</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;StepNavigationTemplateContainerID$StepNextButton&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">UniqueID</span><span style="color: #008000;">;</span>
                    <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: DRWebMonkey</title>
		<link>http://www.leghumped.com/blog/2009/01/05/default-wizard-button-in-aspnet/comment-page-1/#comment-5085</link>
		<dc:creator>DRWebMonkey</dc:creator>
		<pubDate>Wed, 11 Mar 2009 17:09:27 +0000</pubDate>
		<guid isPermaLink="false">http://leghumped.com/blog/?p=336#comment-5085</guid>
		<description>I used the following, inspired by your code from inside the ActiveStepChanged step
&lt;pre lang=&quot;vbnet&quot;&gt;
        If CType(sender, Wizard).FindControl(&quot;StepNavigationTemplateContainerID$StartNextButton&quot;) IsNot Nothing Then
            Page.Form.DefaultButton = CType(sender, Wizard).FindControl(&quot;StepNavigationTemplateContainerID$StartNextButton&quot;).UniqueID
        End If
        If CType(sender, Wizard).FindControl(&quot;FinishNavigationTemplateContainerID$FinishButton&quot;) IsNot Nothing Then
            Page.Form.DefaultButton = CType(sender, Wizard).FindControl(&quot;FinishNavigationTemplateContainerID$FinishButton&quot;).UniqueID
        End If
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I used the following, inspired by your code from inside the ActiveStepChanged step</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">        <span style="color: #0600FF;">If</span> <span style="color: #0600FF;">CType</span><span style="color: #000000;">&#40;</span>sender, Wizard<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">FindControl</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;StepNavigationTemplateContainerID$StartNextButton&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">IsNot</span> <span style="color: #FF8000;">Nothing</span> <span style="color: #FF8000;">Then</span>
            Page.<span style="color: #0000FF;">Form</span>.<span style="color: #0000FF;">DefaultButton</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">CType</span><span style="color: #000000;">&#40;</span>sender, Wizard<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">FindControl</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;StepNavigationTemplateContainerID$StartNextButton&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">UniqueID</span>
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
        <span style="color: #0600FF;">If</span> <span style="color: #0600FF;">CType</span><span style="color: #000000;">&#40;</span>sender, Wizard<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">FindControl</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;FinishNavigationTemplateContainerID$FinishButton&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">IsNot</span> <span style="color: #FF8000;">Nothing</span> <span style="color: #FF8000;">Then</span>
            Page.<span style="color: #0000FF;">Form</span>.<span style="color: #0000FF;">DefaultButton</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">CType</span><span style="color: #000000;">&#40;</span>sender, Wizard<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">FindControl</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;FinishNavigationTemplateContainerID$FinishButton&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">UniqueID</span>
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span></pre></div></div>

]]></content:encoded>
	</item>
</channel>
</rss>

