Accessing Wizard Next/Prev buttons

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GaryDean

    Accessing Wizard Next/Prev buttons

    I have a Wizard page and need to affect the next and previous buttons from
    my code-behind. I've googled around and found two solutions, and neither
    appear to work.

    I can access the SideBarList steps successfully with the following code...

    Control myContainer =
    (Control)Wizard 1.FindControl(" SideBarContaine r");
    DataList mySideBarList =
    (DataList)myCon tainer.FindCont rol("SideBarLis t");
    mySideBarList.E nabled = false;

    Trying to take this approach with the StepNavigationT emplate does not seem
    to work. I first converted the step navigation to a template but I cannot
    get findcontrol to find anything in "StepNavigation Container" or
    "StepNavigation Template" or anything else I can think of.

    I have also tried putting .hidden {display:none} in my .css file and ....

    protected void Wizard1_ActiveS tepChanged(obje ct sender, EventArgs e)
    {
    if (Wizard1.Active StepIndex == 3)
    {
    Wizard1.StepPre viousButtonStyl e.CssClass = "hidden";
    Wizard1.StepNex tButtonStyle.Cs sClass = "hidden";
    }
    }

    This has the effect of not working when goint to step 3 as the Prev/finish
    still show. However if the prev button is hit, step 2 shows with the next
    button not visible.

    Is there a solution to this problem? Is there a reliable way to access
    these buttons?

    Thanks,
    Gary

  • GaryDean

    #2
    Re: Accessing Wizard Next/Prev buttons

    Your code in the Wizard1_load event has the effect of not taking effect
    until the user hits the previous button that was supposed to be non-visible.
    then when we go back to step 2 the previous button is indeed visible.

    This is another attempt in my code (I use the WizardStep activate and
    deactivate events as I find them more reliable than the regular wizard
    navigate events). This is very interesting....

    Here I am disabling the datalist in the SideBarContaine r and it works
    immediately and just fine. the very code below it which I got from you also
    appears to work when I step through it in debug mode i.e the PreviousButton
    is found and it is set to non visible. But on the page when the step 4
    shows the previous button is alive and well! Only when I hit that
    previousbutton do I go back and, guess what, the previous button no longer
    appears on step 2. In other words it happens a step late.

    protected void WizardStep4_Act ivate(object sender, EventArgs e)
    {
    Session["curpage"] = "4";
    //deactivate navigation capability throughout the wizard - the user
    is done.

    Control myContainer =
    (Control)Wizard 1.FindControl(" SideBarContaine r");
    DataList mySideBarList =
    (DataList)myCon tainer.FindCont rol("SideBarLis t");
    mySideBarList.E nabled = false;

    Control ctrl =
    Wizard1.FindCon trol("StepNavig ationTemplateCo ntainerID");
    Button myPrevButton =
    (Button)ctrl.Fi ndControl("Step PreviousButton" );
    myPrevButton.Vi sible = false;

    Pulling my hair out!
    Gary

    "Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
    news:pe%23IzxC2 IHA.1788@TK2MSF TNGHUB02.phx.gb l...
    Hi Gary,
    >
    As for the Wizard control, those different Container (such as Navigation
    Panel , SideBar Panel...) , they're separate from each other (under the
    Wizard control's Sub control colleciton). Therefore, if you want to lookup
    any child control within any of them, you need to get reference to the
    certain container first. Generally, a useful means to determine the
    control structure/hierarchy is turn on page's output trace (see the below
    directive):
    >
    =============== ======
    <%@ Page Language="C#" AutoEventWireup ="true" CodeFile="CSWiz ard.aspx.cs"
    Inherits="CSWiz ard"
    Trace="true" %>
    >
    =============== ===
    >
    And based on my test, the "Navigation container"'s control ID is
    "StepNavigation TemplateContain erID". You can use it to get the Navigation
    container control first, and call FindControl on it to get the
    "MovePreviousBu tton" and "MoveNextButton ".
    >
    here is a simple test page I've used. Also, "ActiveStepChan ged" event is
    not the proper event to lookup control collection (because at that time,
    the new Step's control collection hasn't been populatd yet). I suggest you
    use "Load" event.
    >
    =============as px template ======
    <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex ="1"
    onactivestepcha nged="Wizard1_A ctiveStepChange d"
    onload="Wizard1 _Load">
    <WizardSteps>
    <asp:WizardSt ep runat="server" title="Step 1">
    <asp:Label ID="Label1" runat="server"
    Text="Label1"></asp:Label>
    <br />
    <asp:Button ID="Button1" runat="server" Text="Button1"
    />
    </asp:WizardStep>
    <asp:WizardSt ep runat="server" title="Step 2">
    <asp:Label ID="Label2" runat="server"
    Text="Label2"></asp:Label>
    <br />
    <asp:Button ID="Button2" runat="server" Text="Button2"
    />
    </asp:WizardStep>
    <asp:WizardSt ep runat="server" Title="Step 3">
    <asp:Label ID="Label3" runat="server"
    Text="Label3"></asp:Label>
    <br />
    <asp:Button ID="Button3" runat="server" Text="Button3"
    />
    </asp:WizardStep>
    <asp:WizardSt ep runat="server" Title="Step 4">
    <asp:Label ID="Label4" runat="server"
    Text="Label4"></asp:Label>
    <br />
    <asp:Button ID="Button4" runat="server" Text="Button4"
    />
    </asp:WizardStep>
    </WizardSteps>
    <StepNavigation Template >
    <asp:Button ID="StepPreviou sButton" runat="server"
    CausesValidatio n="False"
    CommandName="Mo vePrevious" Text="Previous" />
    <asp:Button ID="StepNextBut ton" runat="server"
    CommandName="Mo veNext"
    Text="Next" />
    </StepNavigationT emplate>
    </asp:Wizard>
    >
    >
    >
    ==========code behind=========
    protected void Wizard1_Load(ob ject sender, EventArgs e)
    {
    Control ctrl =
    Wizard1.FindCon trol("StepNavig ationTemplateCo ntainerID");
    >
    Response.Write( "<br/>Wizard1_Load:" );
    Button btn1 = ctrl.FindContro l("StepPrevious Button") as Button;
    Button btn2 = ctrl.FindContro l("StepNextButt on") as Button;
    >
    Response.Write( "<br/>" + btn1 + " | " + btn2);
    }
    }
    =============== =======
    >
    Hope this helps.
    >
    Sincerely,
    >
    Steven Cheng
    >
    Microsoft MSDN Online Support Lead
    >
    >
    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    msdnmg@microsof t.com.
    >
    =============== =============== =============== =====
    Get notification to my posts through email? Please refer to
    Gain technical skills through documentation and training, earn certifications and connect with the community

    ications.
    >
    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscripti...t/default.aspx.
    =============== =============== =============== =====
    This posting is provided "AS IS" with no warranties, and confers no
    rights.
    >
    --------------------
    >>From: "GaryDean" <gdeanblakely@n ewsgroup.nospam >
    >>Subject: Accessing Wizard Next/Prev buttons
    >>Date: Thu, 26 Jun 2008 10:59:43 -0600
    >
    >>
    >>I have a Wizard page and need to affect the next and previous buttons from
    >>my code-behind. I've googled around and found two solutions, and neither
    >>appear to work.
    >>
    >>I can access the SideBarList steps successfully with the following code...
    >>
    > Control myContainer =
    >>(Control)Wiza rd1.FindControl ("SideBarContai ner");
    > DataList mySideBarList =
    >>(DataList)myC ontainer.FindCo ntrol("SideBarL ist");
    > mySideBarList.E nabled = false;
    >>
    >>Trying to take this approach with the StepNavigationT emplate does not seem
    >>to work. I first converted the step navigation to a template but I cannot
    >>get findcontrol to find anything in "StepNavigation Container" or
    >>"StepNavigati onTemplate" or anything else I can think of.
    >>
    >>I have also tried putting .hidden {display:none} in my .css file and ....
    >>
    > protected void Wizard1_ActiveS tepChanged(obje ct sender, EventArgs e)
    > {
    > if (Wizard1.Active StepIndex == 3)
    > {
    > Wizard1.StepPre viousButtonStyl e.CssClass = "hidden";
    > Wizard1.StepNex tButtonStyle.Cs sClass = "hidden";
    > }
    > }
    >>
    >>This has the effect of not working when goint to step 3 as the Prev/finish
    >>still show. However if the prev button is hit, step 2 shows with the next
    >>button not visible.
    >>
    >>Is there a solution to this problem? Is there a reliable way to access
    >>these buttons?
    >>
    >>Thanks,
    >>Gary
    >>
    >>
    >

    Comment

    • Steven Cheng [MSFT]

      #3
      Re: Accessing Wizard Next/Prev buttons

      Thanks for your reply Gary,

      Don't worry, I think there might be some status which hasn't been
      maintained correctly here. To better test the behavior, would you send me a
      simplified page which use a wizard control to demonstrate what you want to
      do? thus, I can test against it on my side. You can reach me at the
      following email address:

      "stcheng" + @ + "microsoft. com"

      Sincerely,

      Steven Cheng
      Microsoft MSDN Online Support Lead

      Delighting our customers is our #1 priority. We welcome your comments and
      suggestions about how we can improve the support we provide to you. Please
      feel free to let my manager know what you think of the level of service
      provided. You can send feedback directly to my manager at:
      msdnmg@microsof t.com.

      =============== =============== =============== =====
      Get notification to my posts through email? Please refer to
      Gain technical skills through documentation and training, earn certifications and connect with the community

      ications.

      =============== =============== =============== =====
      This posting is provided "AS IS" with no warranties, and confers no rights.

      --------------------
      >From: "GaryDean" <gdeanblakely@n ewsgroup.nospam >
      >References: <eCOCJ461IHA.55 2@TK2MSFTNGP06. phx.gbl>
      <pe#IzxC2IHA.17 88@TK2MSFTNGHUB 02.phx.gbl>
      >In-Reply-To: <pe#IzxC2IHA.17 88@TK2MSFTNGHUB 02.phx.gbl>
      >Subject: Re: Accessing Wizard Next/Prev buttons
      >Date: Sat, 28 Jun 2008 18:51:32 -0600
      >
      >Your code in the Wizard1_load event has the effect of not taking effect
      >until the user hits the previous button that was supposed to be
      non-visible.
      >then when we go back to step 2 the previous button is indeed visible.
      >
      >This is another attempt in my code (I use the WizardStep activate and
      >deactivate events as I find them more reliable than the regular wizard
      >navigate events). This is very interesting....
      >
      >Here I am disabling the datalist in the SideBarContaine r and it works
      >immediately and just fine. the very code below it which I got from you
      also
      >appears to work when I step through it in debug mode i.e the
      PreviousButton
      >is found and it is set to non visible. But on the page when the step 4
      >shows the previous button is alive and well! Only when I hit that
      >previousbutt on do I go back and, guess what, the previous button no longer
      >appears on step 2. In other words it happens a step late.
      >
      protected void WizardStep4_Act ivate(object sender, EventArgs e)
      {
      Session["curpage"] = "4";
      //deactivate navigation capability throughout the wizard - the
      user
      >is done.
      >
      Control myContainer =
      >(Control)Wizar d1.FindControl( "SideBarContain er");
      DataList mySideBarList =
      >(DataList)myCo ntainer.FindCon trol("SideBarLi st");
      mySideBarList.E nabled = false;
      >
      Control ctrl =
      >Wizard1.FindCo ntrol("StepNavi gationTemplateC ontainerID");
      Button myPrevButton =
      >(Button)ctrl.F indControl("Ste pPreviousButton ");
      myPrevButton.Vi sible = false;
      >
      >Pulling my hair out!
      >Gary
      >
      >"Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
      >news:pe%23IzxC 2IHA.1788@TK2MS FTNGHUB02.phx.g bl...
      >Hi Gary,
      >>
      >As for the Wizard control, those different Container (such as Navigation
      >Panel , SideBar Panel...) , they're separate from each other (under the
      >Wizard control's Sub control colleciton). Therefore, if you want to
      lookup
      >any child control within any of them, you need to get reference to the
      >certain container first. Generally, a useful means to determine the
      >control structure/hierarchy is turn on page's output trace (see the below
      >directive):
      >>
      >============== =======
      ><%@ Page Language="C#" AutoEventWireup ="true" CodeFile="CSWiz ard.aspx.cs"
      >Inherits="CSWi zard"
      >Trace="true" %>
      >>
      >============== ====
      >>
      >And based on my test, the "Navigation container"'s control ID is
      >"StepNavigatio nTemplateContai nerID". You can use it to get the
      Navigation
      >container control first, and call FindControl on it to get the
      >"MovePreviousB utton" and "MoveNextButton ".
      >>
      >here is a simple test page I've used. Also, "ActiveStepChan ged" event is
      >not the proper event to lookup control collection (because at that time,
      >the new Step's control collection hasn't been populatd yet). I suggest
      you
      >use "Load" event.
      >>
      >=============a spx template ======
      > <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex ="1"
      > onactivestepcha nged="Wizard1_A ctiveStepChange d"
      >onload="Wizard 1_Load">
      > <WizardSteps>
      > <asp:WizardSt ep runat="server" title="Step 1">
      > <asp:Label ID="Label1" runat="server"
      >Text="Label1"> </asp:Label>
      > <br />
      > <asp:Button ID="Button1" runat="server" Text="Button1"
      >/>
      > </asp:WizardStep>
      > <asp:WizardSt ep runat="server" title="Step 2">
      > <asp:Label ID="Label2" runat="server"
      >Text="Label2"> </asp:Label>
      > <br />
      > <asp:Button ID="Button2" runat="server" Text="Button2"
      >/>
      > </asp:WizardStep>
      > <asp:WizardSt ep runat="server" Title="Step 3">
      > <asp:Label ID="Label3" runat="server"
      >Text="Label3"> </asp:Label>
      > <br />
      > <asp:Button ID="Button3" runat="server" Text="Button3"
      >/>
      > </asp:WizardStep>
      > <asp:WizardSt ep runat="server" Title="Step 4">
      > <asp:Label ID="Label4" runat="server"
      >Text="Label4"> </asp:Label>
      > <br />
      > <asp:Button ID="Button4" runat="server" Text="Button4"
      >/>
      > </asp:WizardStep>
      > </WizardSteps>
      > <StepNavigation Template >
      > <asp:Button ID="StepPreviou sButton" runat="server"
      >CausesValidati on="False"
      > CommandName="Mo vePrevious" Text="Previous" />
      > <asp:Button ID="StepNextBut ton" runat="server"
      >CommandName="M oveNext"
      > Text="Next" />
      > </StepNavigationT emplate>
      > </asp:Wizard>
      >>
      >>
      >>
      >==========co de behind=========
      > protected void Wizard1_Load(ob ject sender, EventArgs e)
      > {
      > Control ctrl =
      >Wizard1.FindCo ntrol("StepNavi gationTemplateC ontainerID");
      >>
      > Response.Write( "<br/>Wizard1_Load:" );
      > Button btn1 = ctrl.FindContro l("StepPrevious Button") as Button;
      > Button btn2 = ctrl.FindContro l("StepNextButt on") as Button;
      >>
      > Response.Write( "<br/>" + btn1 + " | " + btn2);
      > }
      >}
      >============== ========
      >>
      >Hope this helps.
      >>
      >Sincerely,
      >>
      >Steven Cheng
      >>
      >Microsoft MSDN Online Support Lead
      >>
      >>
      >Delighting our customers is our #1 priority. We welcome your comments and
      >suggestions about how we can improve the support we provide to you.
      Please
      >feel free to let my manager know what you think of the level of service
      >provided. You can send feedback directly to my manager at:
      >msdnmg@microsof t.com.
      >>
      >============== =============== =============== ======
      >Get notification to my posts through email? Please refer to
      >>
      http://msdn.microsoft.com/subscripti...ult.aspx#notif
      >ications.
      >>
      >Note: The MSDN Managed Newsgroup support offering is for non-urgent
      issues
      >where an initial response from the community or a Microsoft Support
      >Engineer within 1 business day is acceptable. Please note that each
      follow
      >up response may take approximately 2 business days as the support
      >professional working with you may need further investigation to reach the
      >most efficient resolution. The offering is not appropriate for situations
      >that require urgent, real-time or phone-based interactions or complex
      >project analysis and dump analysis issues. Issues of this nature are best
      >handled working with a dedicated Microsoft Support Engineer by contacting
      >Microsoft Customer Support Services (CSS) at
      >http://msdn.microsoft.com/subscripti...t/default.aspx.
      >============== =============== =============== ======
      >This posting is provided "AS IS" with no warranties, and confers no
      >rights.
      >>
      >--------------------
      >>>From: "GaryDean" <gdeanblakely@n ewsgroup.nospam >
      >>>Subject: Accessing Wizard Next/Prev buttons
      >>>Date: Thu, 26 Jun 2008 10:59:43 -0600
      >>
      >>>
      >>>I have a Wizard page and need to affect the next and previous buttons
      from
      >>>my code-behind. I've googled around and found two solutions, and neither
      >>>appear to work.
      >>>
      >>>I can access the SideBarList steps successfully with the following
      code...
      >>>
      >> Control myContainer =
      >>>(Control)Wiz ard1.FindContro l("SideBarConta iner");
      >> DataList mySideBarList =
      >>>(DataList)my Container.FindC ontrol("SideBar List");
      >> mySideBarList.E nabled = false;
      >>>
      >>>Trying to take this approach with the StepNavigationT emplate does not
      seem
      >>>to work. I first converted the step navigation to a template but I
      cannot
      >>>get findcontrol to find anything in "StepNavigation Container" or
      >>>"StepNavigat ionTemplate" or anything else I can think of.
      >>>
      >>>I have also tried putting .hidden {display:none} in my .css file and ....
      >>>
      >> protected void Wizard1_ActiveS tepChanged(obje ct sender, EventArgs e)
      >> {
      >> if (Wizard1.Active StepIndex == 3)
      >> {
      >> Wizard1.StepPre viousButtonStyl e.CssClass = "hidden";
      >> Wizard1.StepNex tButtonStyle.Cs sClass = "hidden";
      >> }
      >> }
      >>>
      >>>This has the effect of not working when goint to step 3 as the
      Prev/finish
      >>>still show. However if the prev button is hit, step 2 shows with the
      next
      >>>button not visible.
      >>>
      >>>Is there a solution to this problem? Is there a reliable way to access
      >>>these buttons?
      >>>
      >>>Thanks,
      >>>Gary
      >>>
      >>>
      >>
      >
      >

      Comment

      • GaryDean

        #4
        Re: Accessing Wizard Next/Prev buttons

        Yes but it might be a few days.
        Thanks.


        "Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
        news:hDnHhE22IH A.3684@TK2MSFTN GHUB02.phx.gbl. ..
        Thanks for your reply Gary,
        >
        Don't worry, I think there might be some status which hasn't been
        maintained correctly here. To better test the behavior, would you send me
        a
        simplified page which use a wizard control to demonstrate what you want to
        do? thus, I can test against it on my side. You can reach me at the
        following email address:
        >
        "stcheng" + @ + "microsoft. com"
        >
        Sincerely,
        >
        Steven Cheng
        Microsoft MSDN Online Support Lead
        >
        Delighting our customers is our #1 priority. We welcome your comments and
        suggestions about how we can improve the support we provide to you. Please
        feel free to let my manager know what you think of the level of service
        provided. You can send feedback directly to my manager at:
        msdnmg@microsof t.com.
        >
        =============== =============== =============== =====
        Get notification to my posts through email? Please refer to
        Gain technical skills through documentation and training, earn certifications and connect with the community

        ications.
        >
        =============== =============== =============== =====
        This posting is provided "AS IS" with no warranties, and confers no
        rights.
        >
        --------------------
        >>From: "GaryDean" <gdeanblakely@n ewsgroup.nospam >
        >>References: <eCOCJ461IHA.55 2@TK2MSFTNGP06. phx.gbl>
        <pe#IzxC2IHA.17 88@TK2MSFTNGHUB 02.phx.gbl>
        >>In-Reply-To: <pe#IzxC2IHA.17 88@TK2MSFTNGHUB 02.phx.gbl>
        >>Subject: Re: Accessing Wizard Next/Prev buttons
        >>Date: Sat, 28 Jun 2008 18:51:32 -0600
        >
        >>
        >>Your code in the Wizard1_load event has the effect of not taking effect
        >>until the user hits the previous button that was supposed to be
        non-visible.
        >>then when we go back to step 2 the previous button is indeed visible.
        >>
        >>This is another attempt in my code (I use the WizardStep activate and
        >>deactivate events as I find them more reliable than the regular wizard
        >>navigate events). This is very interesting....
        >>
        >>Here I am disabling the datalist in the SideBarContaine r and it works
        >>immediately and just fine. the very code below it which I got from you
        also
        >>appears to work when I step through it in debug mode i.e the
        PreviousButton
        >>is found and it is set to non visible. But on the page when the step 4
        >>shows the previous button is alive and well! Only when I hit that
        >>previousbutto n do I go back and, guess what, the previous button no longer
        >>appears on step 2. In other words it happens a step late.
        >>
        > protected void WizardStep4_Act ivate(object sender, EventArgs e)
        > {
        > Session["curpage"] = "4";
        > //deactivate navigation capability throughout the wizard - the
        user
        >>is done.
        >>
        > Control myContainer =
        >>(Control)Wiza rd1.FindControl ("SideBarContai ner");
        > DataList mySideBarList =
        >>(DataList)myC ontainer.FindCo ntrol("SideBarL ist");
        > mySideBarList.E nabled = false;
        >>
        > Control ctrl =
        >>Wizard1.FindC ontrol("StepNav igationTemplate ContainerID");
        > Button myPrevButton =
        >>(Button)ctrl. FindControl("St epPreviousButto n");
        > myPrevButton.Vi sible = false;
        >>
        >>Pulling my hair out!
        >>Gary
        >>
        >>"Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
        >>news:pe%23Izx C2IHA.1788@TK2M SFTNGHUB02.phx. gbl...
        >>Hi Gary,
        >>>
        >>As for the Wizard control, those different Container (such as Navigation
        >>Panel , SideBar Panel...) , they're separate from each other (under the
        >>Wizard control's Sub control colleciton). Therefore, if you want to
        lookup
        >>any child control within any of them, you need to get reference to the
        >>certain container first. Generally, a useful means to determine the
        >>control structure/hierarchy is turn on page's output trace (see the
        >>below
        >>directive):
        >>>
        >>============= ========
        >><%@ Page Language="C#" AutoEventWireup ="true"
        >>CodeFile="CSW izard.aspx.cs"
        >>Inherits="CSW izard"
        >>Trace="true " %>
        >>>
        >>============= =====
        >>>
        >>And based on my test, the "Navigation container"'s control ID is
        >>"StepNavigati onTemplateConta inerID". You can use it to get the
        Navigation
        >>container control first, and call FindControl on it to get the
        >>"MovePrevious Button" and "MoveNextButton ".
        >>>
        >>here is a simple test page I've used. Also, "ActiveStepChan ged" event
        >>is
        >>not the proper event to lookup control collection (because at that time,
        >>the new Step's control collection hasn't been populatd yet). I suggest
        you
        >>use "Load" event.
        >>>
        >>============= aspx template ======
        >> <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex ="1"
        >> onactivestepcha nged="Wizard1_A ctiveStepChange d"
        >>onload="Wizar d1_Load">
        >> <WizardSteps>
        >> <asp:WizardSt ep runat="server" title="Step 1">
        >> <asp:Label ID="Label1" runat="server"
        >>Text="Label1" ></asp:Label>
        >> <br />
        >> <asp:Button ID="Button1" runat="server"
        >>Text="Button1 "
        >>/>
        >> </asp:WizardStep>
        >> <asp:WizardSt ep runat="server" title="Step 2">
        >> <asp:Label ID="Label2" runat="server"
        >>Text="Label2" ></asp:Label>
        >> <br />
        >> <asp:Button ID="Button2" runat="server"
        >>Text="Button2 "
        >>/>
        >> </asp:WizardStep>
        >> <asp:WizardSt ep runat="server" Title="Step 3">
        >> <asp:Label ID="Label3" runat="server"
        >>Text="Label3" ></asp:Label>
        >> <br />
        >> <asp:Button ID="Button3" runat="server"
        >>Text="Button3 "
        >>/>
        >> </asp:WizardStep>
        >> <asp:WizardSt ep runat="server" Title="Step 4">
        >> <asp:Label ID="Label4" runat="server"
        >>Text="Label4" ></asp:Label>
        >> <br />
        >> <asp:Button ID="Button4" runat="server"
        >>Text="Button4 "
        >>/>
        >> </asp:WizardStep>
        >> </WizardSteps>
        >> <StepNavigation Template >
        >> <asp:Button ID="StepPreviou sButton" runat="server"
        >>CausesValidat ion="False"
        >> CommandName="Mo vePrevious" Text="Previous" />
        >> <asp:Button ID="StepNextBut ton" runat="server"
        >>CommandName=" MoveNext"
        >> Text="Next" />
        >> </StepNavigationT emplate>
        >> </asp:Wizard>
        >>>
        >>>
        >>>
        >>==========cod e behind=========
        >> protected void Wizard1_Load(ob ject sender, EventArgs e)
        >> {
        >> Control ctrl =
        >>Wizard1.FindC ontrol("StepNav igationTemplate ContainerID");
        >>>
        >> Response.Write( "<br/>Wizard1_Load:" );
        >> Button btn1 = ctrl.FindContro l("StepPrevious Button") as Button;
        >> Button btn2 = ctrl.FindContro l("StepNextButt on") as Button;
        >>>
        >> Response.Write( "<br/>" + btn1 + " | " + btn2);
        >> }
        >>}
        >>============= =========
        >>>
        >>Hope this helps.
        >>>
        >>Sincerely,
        >>>
        >>Steven Cheng
        >>>
        >>Microsoft MSDN Online Support Lead
        >>>
        >>>
        >>Delighting our customers is our #1 priority. We welcome your comments
        >>and
        >>suggestions about how we can improve the support we provide to you.
        Please
        >>feel free to let my manager know what you think of the level of service
        >>provided. You can send feedback directly to my manager at:
        >>msdnmg@microsof t.com.
        >>>
        >>============= =============== =============== =======
        >>Get notification to my posts through email? Please refer to
        >>>
        http://msdn.microsoft.com/subscripti...ult.aspx#notif
        >>ications.
        >>>
        >>Note: The MSDN Managed Newsgroup support offering is for non-urgent
        issues
        >>where an initial response from the community or a Microsoft Support
        >>Engineer within 1 business day is acceptable. Please note that each
        follow
        >>up response may take approximately 2 business days as the support
        >>professiona l working with you may need further investigation to reach
        >>the
        >>most efficient resolution. The offering is not appropriate for
        >>situations
        >>that require urgent, real-time or phone-based interactions or complex
        >>project analysis and dump analysis issues. Issues of this nature are
        >>best
        >>handled working with a dedicated Microsoft Support Engineer by
        >>contacting
        >>Microsoft Customer Support Services (CSS) at
        >>http://msdn.microsoft.com/subscripti...t/default.aspx.
        >>============= =============== =============== =======
        >>This posting is provided "AS IS" with no warranties, and confers no
        >>rights.
        >>>
        >>--------------------
        >>>>From: "GaryDean" <gdeanblakely@n ewsgroup.nospam >
        >>>>Subject: Accessing Wizard Next/Prev buttons
        >>>>Date: Thu, 26 Jun 2008 10:59:43 -0600
        >>>
        >>>>
        >>>>I have a Wizard page and need to affect the next and previous buttons
        from
        >>>>my code-behind. I've googled around and found two solutions, and
        >>>>neither
        >>>>appear to work.
        >>>>
        >>>>I can access the SideBarList steps successfully with the following
        code...
        >>>>
        >>> Control myContainer =
        >>>>(Control)Wi zard1.FindContr ol("SideBarCont ainer");
        >>> DataList mySideBarList =
        >>>>(DataList)m yContainer.Find Control("SideBa rList");
        >>> mySideBarList.E nabled = false;
        >>>>
        >>>>Trying to take this approach with the StepNavigationT emplate does not
        seem
        >>>>to work. I first converted the step navigation to a template but I
        cannot
        >>>>get findcontrol to find anything in "StepNavigation Container" or
        >>>>"StepNaviga tionTemplate" or anything else I can think of.
        >>>>
        >>>>I have also tried putting .hidden {display:none} in my .css file and
        >>>>....
        >>>>
        >>> protected void Wizard1_ActiveS tepChanged(obje ct sender, EventArgs e)
        >>> {
        >>> if (Wizard1.Active StepIndex == 3)
        >>> {
        >>> Wizard1.StepPre viousButtonStyl e.CssClass = "hidden";
        >>> Wizard1.StepNex tButtonStyle.Cs sClass = "hidden";
        >>> }
        >>> }
        >>>>
        >>>>This has the effect of not working when goint to step 3 as the
        Prev/finish
        >>>>still show. However if the prev button is hit, step 2 shows with the
        next
        >>>>button not visible.
        >>>>
        >>>>Is there a solution to this problem? Is there a reliable way to access
        >>>>these buttons?
        >>>>
        >>>>Thanks,
        >>>>Gary
        >>>>
        >>>>
        >>>
        >>
        >>
        >

        Comment

        • Steven Cheng [MSFT]

          #5
          Re: Accessing Wizard Next/Prev buttons

          Thanks for your reply Gary,

          No problem. Please feel free to let me know at your convenience.

          Sincerely,

          Steven Cheng

          Microsoft MSDN Online Support Lead


          Delighting our customers is our #1 priority. We welcome your comments and
          suggestions about how we can improve the support we provide to you. Please
          feel free to let my manager know what you think of the level of service
          provided. You can send feedback directly to my manager at:
          msdnmg@microsof t.com.

          =============== =============== =============== =====
          Get notification to my posts through email? Please refer to
          Gain technical skills through documentation and training, earn certifications and connect with the community

          ications.
          =============== =============== =============== =====
          This posting is provided "AS IS" with no warranties, and confers no rights.

          --------------------
          >From: "GaryDean" <gdeanblakely@n ewsgroup.nospam >
          >References: <eCOCJ461IHA.55 2@TK2MSFTNGP06. phx.gbl>
          <pe#IzxC2IHA.17 88@TK2MSFTNGHUB 02.phx.gbl>
          <#F4iIJY2IHA.49 12@TK2MSFTNGP03 .phx.gbl>
          <hDnHhE22IHA.36 84@TK2MSFTNGHUB 02.phx.gbl>
          >In-Reply-To: <hDnHhE22IHA.36 84@TK2MSFTNGHUB 02.phx.gbl>
          >Subject: Re: Accessing Wizard Next/Prev buttons
          >Date: Tue, 1 Jul 2008 17:24:35 -0600
          >
          >Yes but it might be a few days.
          >Thanks.
          >
          >
          >"Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
          >news:hDnHhE22I HA.3684@TK2MSFT NGHUB02.phx.gbl ...
          >Thanks for your reply Gary,
          >>
          >Don't worry, I think there might be some status which hasn't been
          >maintained correctly here. To better test the behavior, would you send
          me
          >a
          >simplified page which use a wizard control to demonstrate what you want
          to
          >do? thus, I can test against it on my side. You can reach me at the
          >following email address:
          >>
          >"stcheng" + @ + "microsoft. com"
          >>
          >Sincerely,
          >>
          >Steven Cheng
          >Microsoft MSDN Online Support Lead
          >>
          >Delighting our customers is our #1 priority. We welcome your comments and
          >suggestions about how we can improve the support we provide to you.
          Please
          >feel free to let my manager know what you think of the level of service
          >provided. You can send feedback directly to my manager at:
          >msdnmg@microsof t.com.
          >>
          >============== =============== =============== ======
          >Get notification to my posts through email? Please refer to
          >>
          http://msdn.microsoft.com/subscripti...ult.aspx#notif
          >ications.
          >>
          >============== =============== =============== ======
          >This posting is provided "AS IS" with no warranties, and confers no
          >rights.
          >>
          >--------------------
          >>>From: "GaryDean" <gdeanblakely@n ewsgroup.nospam >
          >>>References : <eCOCJ461IHA.55 2@TK2MSFTNGP06. phx.gbl>
          ><pe#IzxC2IHA.1 788@TK2MSFTNGHU B02.phx.gbl>
          >>>In-Reply-To: <pe#IzxC2IHA.17 88@TK2MSFTNGHUB 02.phx.gbl>
          >>>Subject: Re: Accessing Wizard Next/Prev buttons
          >>>Date: Sat, 28 Jun 2008 18:51:32 -0600
          >>
          >>>
          >>>Your code in the Wizard1_load event has the effect of not taking effect
          >>>until the user hits the previous button that was supposed to be
          >non-visible.
          >>>then when we go back to step 2 the previous button is indeed visible.
          >>>
          >>>This is another attempt in my code (I use the WizardStep activate and
          >>>deactivate events as I find them more reliable than the regular wizard
          >>>navigate events). This is very interesting....
          >>>
          >>>Here I am disabling the datalist in the SideBarContaine r and it works
          >>>immediatel y and just fine. the very code below it which I got from you
          >also
          >>>appears to work when I step through it in debug mode i.e the
          >PreviousButt on
          >>>is found and it is set to non visible. But on the page when the step 4
          >>>shows the previous button is alive and well! Only when I hit that
          >>>previousbutt on do I go back and, guess what, the previous button no
          longer
          >>>appears on step 2. In other words it happens a step late.
          >>>
          >> protected void WizardStep4_Act ivate(object sender, EventArgs e)
          >> {
          >> Session["curpage"] = "4";
          >> //deactivate navigation capability throughout the wizard - the
          >user
          >>>is done.
          >>>
          >> Control myContainer =
          >>>(Control)Wiz ard1.FindContro l("SideBarConta iner");
          >> DataList mySideBarList =
          >>>(DataList)my Container.FindC ontrol("SideBar List");
          >> mySideBarList.E nabled = false;
          >>>
          >> Control ctrl =
          >>>Wizard1.Find Control("StepNa vigationTemplat eContainerID");
          >> Button myPrevButton =
          >>>(Button)ctrl .FindControl("S tepPreviousButt on");
          >> myPrevButton.Vi sible = false;
          >>>
          >>>Pulling my hair out!
          >>>Gary
          >>>
          >>>"Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
          >>>news:pe%23Iz xC2IHA.1788@TK2 MSFTNGHUB02.phx .gbl...
          >>>Hi Gary,
          >>>>
          >>>As for the Wizard control, those different Container (such as
          Navigation
          >>>Panel , SideBar Panel...) , they're separate from each other (under the
          >>>Wizard control's Sub control colleciton). Therefore, if you want to
          >lookup
          >>>any child control within any of them, you need to get reference to the
          >>>certain container first. Generally, a useful means to determine the
          >>>control structure/hierarchy is turn on page's output trace (see the
          >>>below
          >>>directive) :
          >>>>
          >>>============ =========
          >>><%@ Page Language="C#" AutoEventWireup ="true"
          >>>CodeFile="CS Wizard.aspx.cs"
          >>>Inherits="CS Wizard"
          >>>Trace="tru e" %>
          >>>>
          >>>============ ======
          >>>>
          >>>And based on my test, the "Navigation container"'s control ID is
          >>>"StepNavigat ionTemplateCont ainerID". You can use it to get the
          >Navigation
          >>>container control first, and call FindControl on it to get the
          >>>"MovePreviou sButton" and "MoveNextButton ".
          >>>>
          >>>here is a simple test page I've used. Also, "ActiveStepChan ged" event
          >>>is
          >>>not the proper event to lookup control collection (because at that
          time,
          >>>the new Step's control collection hasn't been populatd yet). I suggest
          >you
          >>>use "Load" event.
          >>>>
          >>>============ =aspx template ======
          >>> <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex ="1"
          >>> onactivestepcha nged="Wizard1_A ctiveStepChange d"
          >>>onload="Wiza rd1_Load">
          >>> <WizardSteps>
          >>> <asp:WizardSt ep runat="server" title="Step 1">
          >>> <asp:Label ID="Label1" runat="server"
          >>>Text="Label1 "></asp:Label>
          >>> <br />
          >>> <asp:Button ID="Button1" runat="server"
          >>>Text="Button 1"
          >>>/>
          >>> </asp:WizardStep>
          >>> <asp:WizardSt ep runat="server" title="Step 2">
          >>> <asp:Label ID="Label2" runat="server"
          >>>Text="Label2 "></asp:Label>
          >>> <br />
          >>> <asp:Button ID="Button2" runat="server"
          >>>Text="Button 2"
          >>>/>
          >>> </asp:WizardStep>
          >>> <asp:WizardSt ep runat="server" Title="Step 3">
          >>> <asp:Label ID="Label3" runat="server"
          >>>Text="Label3 "></asp:Label>
          >>> <br />
          >>> <asp:Button ID="Button3" runat="server"
          >>>Text="Button 3"
          >>>/>
          >>> </asp:WizardStep>
          >>> <asp:WizardSt ep runat="server" Title="Step 4">
          >>> <asp:Label ID="Label4" runat="server"
          >>>Text="Label4 "></asp:Label>
          >>> <br />
          >>> <asp:Button ID="Button4" runat="server"
          >>>Text="Button 4"
          >>>/>
          >>> </asp:WizardStep>
          >>> </WizardSteps>
          >>> <StepNavigation Template >
          >>> <asp:Button ID="StepPreviou sButton" runat="server"
          >>>CausesValida tion="False"
          >>> CommandName="Mo vePrevious" Text="Previous" />
          >>> <asp:Button ID="StepNextBut ton" runat="server"
          >>>CommandName= "MoveNext"
          >>> Text="Next" />
          >>> </StepNavigationT emplate>
          >>> </asp:Wizard>
          >>>>
          >>>>
          >>>>
          >>>==========co de behind=========
          >>> protected void Wizard1_Load(ob ject sender, EventArgs e)
          >>> {
          >>> Control ctrl =
          >>>Wizard1.Find Control("StepNa vigationTemplat eContainerID");
          >>>>
          >>> Response.Write( "<br/>Wizard1_Load:" );
          >>> Button btn1 = ctrl.FindContro l("StepPrevious Button") as Button;
          >>> Button btn2 = ctrl.FindContro l("StepNextButt on") as Button;
          >>>>
          >>> Response.Write( "<br/>" + btn1 + " | " + btn2);
          >>> }
          >>>}
          >>>============ ==========
          >>>>
          >>>Hope this helps.
          >>>>
          >>>Sincerely,
          >>>>
          >>>Steven Cheng
          >>>>
          >>>Microsoft MSDN Online Support Lead
          >>>>
          >>>>
          >>>Delighting our customers is our #1 priority. We welcome your comments
          >>>and
          >>>suggestion s about how we can improve the support we provide to you.
          >Please
          >>>feel free to let my manager know what you think of the level of service
          >>>provided. You can send feedback directly to my manager at:
          >>>msdnmg@microsof t.com.
          >>>>
          >>>============ =============== =============== ========
          >>>Get notification to my posts through email? Please refer to
          >>>>
          >>
          http://msdn.microsoft.com/subscripti...ult.aspx#notif
          >>>ications.
          >>>>
          >>>Note: The MSDN Managed Newsgroup support offering is for non-urgent
          >issues
          >>>where an initial response from the community or a Microsoft Support
          >>>Engineer within 1 business day is acceptable. Please note that each
          >follow
          >>>up response may take approximately 2 business days as the support
          >>>profession al working with you may need further investigation to reach
          >>>the
          >>>most efficient resolution. The offering is not appropriate for
          >>>situations
          >>>that require urgent, real-time or phone-based interactions or complex
          >>>project analysis and dump analysis issues. Issues of this nature are
          >>>best
          >>>handled working with a dedicated Microsoft Support Engineer by
          >>>contacting
          >>>Microsoft Customer Support Services (CSS) at
          >>>http://msdn.microsoft.com/subscripti...t/default.aspx.
          >>>============ =============== =============== ========
          >>>This posting is provided "AS IS" with no warranties, and confers no
          >>>rights.
          >>>>
          >>>--------------------
          >>>>>From: "GaryDean" <gdeanblakely@n ewsgroup.nospam >
          >>>>>Subject: Accessing Wizard Next/Prev buttons
          >>>>>Date: Thu, 26 Jun 2008 10:59:43 -0600
          >>>>
          >>>>>
          >>>>>I have a Wizard page and need to affect the next and previous buttons
          >from
          >>>>>my code-behind. I've googled around and found two solutions, and
          >>>>>neither
          >>>>>appear to work.
          >>>>>
          >>>>>I can access the SideBarList steps successfully with the following
          >code...
          >>>>>
          >>>> Control myContainer =
          >>>>>(Control)W izard1.FindCont rol("SideBarCon tainer");
          >>>> DataList mySideBarList =
          >>>>>(DataList) myContainer.Fin dControl("SideB arList");
          >>>> mySideBarList.E nabled = false;
          >>>>>
          >>>>>Trying to take this approach with the StepNavigationT emplate does not
          >seem
          >>>>>to work. I first converted the step navigation to a template but I
          >cannot
          >>>>>get findcontrol to find anything in "StepNavigation Container" or
          >>>>>"StepNavig ationTemplate" or anything else I can think of.
          >>>>>
          >>>>>I have also tried putting .hidden {display:none} in my .css file and
          >>>>>....
          >>>>>
          >>>> protected void Wizard1_ActiveS tepChanged(obje ct sender, EventArgs
          e)
          >>>> {
          >>>> if (Wizard1.Active StepIndex == 3)
          >>>> {
          >>>> Wizard1.StepPre viousButtonStyl e.CssClass = "hidden";
          >>>> Wizard1.StepNex tButtonStyle.Cs sClass = "hidden";
          >>>> }
          >>>> }
          >>>>>
          >>>>>This has the effect of not working when goint to step 3 as the
          >Prev/finish
          >>>>>still show. However if the prev button is hit, step 2 shows with the
          >next
          >>>>>button not visible.
          >>>>>
          >>>>>Is there a solution to this problem? Is there a reliable way to access
          >>>>>these buttons?
          >>>>>
          >>>>>Thanks,
          >>>>>Gary
          >>>>>
          >>>>>
          >>>>
          >>>
          >>>
          >>
          >
          >

          Comment

          • Steven Cheng [MSFT]

            #6
            Re: Accessing Wizard Next/Prev buttons


            Hi Gary,

            I have performed some test against the sample page you provided. Here are
            some of my test results according to your previous reply in the newsgroup
            thread:

            1. At the beginning, both next/previous buttons and side bar links can help
            navigate between steps
            2. After I reach the final step(step4), sidebar is disabled, and I can only
            move to previous step via "previous" button.
            3. However, when I move to step2, the previous button still exists(per your
            description in newsgroup, this button disappear in step2?). And only if I
            reach step1 will the "previous" button disappear.

            So far, what I'm not clear is why don't you also disable "Previous button"
            when reach step4, but only disable the sidebar? Also, if there is any
            other problems here, please feel free to let me know.

            Sincerely,

            Steven Cheng

            Microsoft MSDN Online Support Lead


            Delighting our customers is our #1 priority. We welcome your comments and
            suggestions about how we can improve the support we provide to you. Please
            feel free to let my manager know what you think of the level of service
            provided. You can send feedback directly to my manager at:
            msdnmg@microsof t.com.

            =============== =============== =============== =====
            Get notification to my posts through email? Please refer to
            Gain technical skills through documentation and training, earn certifications and connect with the community

            ications.

            Comment

            • Steven Cheng [MSFT]

              #7
              Re: Accessing Wizard Next/Prev buttons

              Hi Gary,

              After some further research, I've figured out the problem.

              Actually, we've made a mistake when locating the "PreviousButton " on the
              last step(the finish step). We originally use the following code:

              ============
              Control ctrl =
              Wizard1.FindCon trol("StepNavig ationTemplateCo ntainerID");
              Button myPrevButton =
              (Button)ctrl.Fi ndControl("Step PreviousButton" );
              myPrevButton.Vi sible = false;

              ============

              this is ok for intermediate step, however, for the finish step/end step,
              you need to search for the "previousButton " in a different Container called
              "FinishNavigati onTemplateConta inerID", also the Button ID is different.
              Here is the code I've used to make the "previous button" in last step
              disabled. The code contains two part:

              1. mark a flag(in session) indicate that we've reach the end

              2. in "PreRender" event of the wizard, we check the flag and determine
              whether to disable the button


              =============== ==========
              protected void WizardStep4_Act ivate(object sender, EventArgs e)
              {
              ............... .......

              Session["finish"] = true;

              }

              =============== ===========

              protected void Wizard1_PreRend er(object sender, EventArgs e)
              {
              if (Session["finish"] != null)
              {
              Control ctrl =
              Wizard1.FindCon trol("FinishNav igationTemplate ContainerID");
              Button myPrevButton =
              (Button)ctrl.Fi ndControl("Fini shPreviousButto n");
              myPrevButton.En abled = false;
              }

              }
              =============== ==========

              Hope this helps. I'll also send you the modified project via email.

              Sincerely,

              Steven Cheng

              Microsoft MSDN Online Support Lead


              Delighting our customers is our #1 priority. We welcome your comments and
              suggestions about how we can improve the support we provide to you. Please
              feel free to let my manager know what you think of the level of service
              provided. You can send feedback directly to my manager at:
              msdnmg@microsof t.com.

              =============== =============== =============== =====
              Get notification to my posts through email? Please refer to
              Gain technical skills through documentation and training, earn certifications and connect with the community

              ications.

              =============== =============== =============== =====
              This posting is provided "AS IS" with no warranties, and confers no rights.

              --------------------
              >X-Tomcat-ID: 8069796
              >Date: Tue, 08 Jul 2008 09:33:48 GMT
              >Subject: Re: Accessing Wizard Next/Prev buttons
              >
              >Hi Gary,
              >
              >I have performed some test against the sample page you provided. Here are
              >some of my test results according to your previous reply in the newsgroup
              >thread:
              >
              >1. At the beginning, both next/previous buttons and side bar links can
              help
              >navigate between steps
              >2. After I reach the final step(step4), sidebar is disabled, and I can
              only
              >move to previous step via "previous" button.
              >3. However, when I move to step2, the previous button still exists(per
              your
              >description in newsgroup, this button disappear in step2?). And only if I
              >reach step1 will the "previous" button disappear.
              >
              >So far, what I'm not clear is why don't you also disable "Previous button"
              >when reach step4, but only disable the sidebar? Also, if there is any
              >other problems here, please feel free to let me know.
              >
              >Sincerely,
              >
              >Steven Cheng
              >
              >Microsoft MSDN Online Support Lead
              >
              >
              >Delighting our customers is our #1 priority. We welcome your comments and
              >suggestions about how we can improve the support we provide to you. Please
              >feel free to let my manager know what you think of the level of service
              >provided. You can send feedback directly to my manager at:
              >msdnmg@microso ft.com.
              >
              >============== =============== =============== ======
              >Get notification to my posts through email? Please refer to
              >http://msdn.microsoft.com/subscripti...ault.aspx#noti
              f
              >ications.
              >
              >

              Comment

              • GaryDean

                #8
                Re: Accessing Wizard Next/Prev buttons

                Steven:
                Wow. that did it! I don't think I would have ever figured this out.
                Thanks for your help.
                Gary

                "Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
                news:4y3GH$j4IH A.1624@TK2MSFTN GHUB02.phx.gbl. ..
                Hi Gary,
                >
                After some further research, I've figured out the problem.
                >
                Actually, we've made a mistake when locating the "PreviousButton " on the
                last step(the finish step). We originally use the following code:
                >
                ============
                Control ctrl =
                Wizard1.FindCon trol("StepNavig ationTemplateCo ntainerID");
                Button myPrevButton =
                (Button)ctrl.Fi ndControl("Step PreviousButton" );
                myPrevButton.Vi sible = false;
                >
                ============
                >
                this is ok for intermediate step, however, for the finish step/end step,
                you need to search for the "previousButton " in a different Container
                called
                "FinishNavigati onTemplateConta inerID", also the Button ID is different.
                Here is the code I've used to make the "previous button" in last step
                disabled. The code contains two part:
                >
                1. mark a flag(in session) indicate that we've reach the end
                >
                2. in "PreRender" event of the wizard, we check the flag and determine
                whether to disable the button
                >
                >
                =============== ==========
                protected void WizardStep4_Act ivate(object sender, EventArgs e)
                {
                ............... .......
                >
                Session["finish"] = true;
                >
                }
                >
                =============== ===========
                >
                protected void Wizard1_PreRend er(object sender, EventArgs e)
                {
                if (Session["finish"] != null)
                {
                Control ctrl =
                Wizard1.FindCon trol("FinishNav igationTemplate ContainerID");
                Button myPrevButton =
                (Button)ctrl.Fi ndControl("Fini shPreviousButto n");
                myPrevButton.En abled = false;
                }
                >
                }
                =============== ==========
                >
                Hope this helps. I'll also send you the modified project via email.
                >
                Sincerely,
                >
                Steven Cheng
                >
                Microsoft MSDN Online Support Lead
                >
                >
                Delighting our customers is our #1 priority. We welcome your comments and
                suggestions about how we can improve the support we provide to you. Please
                feel free to let my manager know what you think of the level of service
                provided. You can send feedback directly to my manager at:
                msdnmg@microsof t.com.
                >
                =============== =============== =============== =====
                Get notification to my posts through email? Please refer to
                Gain technical skills through documentation and training, earn certifications and connect with the community

                ications.
                >
                =============== =============== =============== =====
                This posting is provided "AS IS" with no warranties, and confers no
                rights.
                >
                --------------------
                >>X-Tomcat-ID: 8069796
                >>Date: Tue, 08 Jul 2008 09:33:48 GMT
                >>Subject: Re: Accessing Wizard Next/Prev buttons
                >
                >>
                >>Hi Gary,
                >>
                >>I have performed some test against the sample page you provided. Here are
                >>some of my test results according to your previous reply in the newsgroup
                >>thread:
                >>
                >>1. At the beginning, both next/previous buttons and side bar links can
                help
                >>navigate between steps
                >>2. After I reach the final step(step4), sidebar is disabled, and I can
                only
                >>move to previous step via "previous" button.
                >>3. However, when I move to step2, the previous button still exists(per
                your
                >>description in newsgroup, this button disappear in step2?). And only if I
                >>reach step1 will the "previous" button disappear.
                >>
                >>So far, what I'm not clear is why don't you also disable "Previous button"
                >>when reach step4, but only disable the sidebar? Also, if there is any
                >>other problems here, please feel free to let me know.
                >>
                >>Sincerely,
                >>
                >>Steven Cheng
                >>
                >>Microsoft MSDN Online Support Lead
                >>
                >>
                >>Delighting our customers is our #1 priority. We welcome your comments and
                >>suggestions about how we can improve the support we provide to you. Please
                >>feel free to let my manager know what you think of the level of service
                >>provided. You can send feedback directly to my manager at:
                >>msdnmg@micros oft.com.
                >>
                >>============= =============== =============== =======
                >>Get notification to my posts through email? Please refer to
                >>http://msdn.microsoft.com/subscripti...ault.aspx#noti
                f
                >>ications.
                >>
                >>
                >

                Comment

                • Steven Cheng [MSFT]

                  #9
                  Re: Accessing Wizard Next/Prev buttons

                  Hi Gary,

                  I'm also very glad that it helps you resolve the problem.

                  If you have any other questions later, always feel free to post in the
                  newsgroup.

                  Have a nice day!

                  Sincerely,

                  Steven Cheng
                  Microsoft MSDN Online Support Lead


                  Delighting our customers is our #1 priority. We welcome your comments and
                  suggestions about how we can improve the support we provide to you. Please
                  feel free to let my manager know what you think of the level of service
                  provided. You can send feedback directly to my manager at:
                  msdnmg@microsof t.com.

                  =============== =============== =============== =====
                  Get notification to my posts through email? Please refer to
                  Gain technical skills through documentation and training, earn certifications and connect with the community

                  ications.

                  This posting is provided "AS IS" with no warranties, and confers no rights.

                  --------------------
                  >From: "GaryDean" <gdeanblakely@n ewsgroup.nospam >
                  >Subject: Re: Accessing Wizard Next/Prev buttons
                  >Date: Thu, 10 Jul 2008 18:26:11 -0600
                  >
                  >Steven:
                  >Wow. that did it! I don't think I would have ever figured this out.
                  >Thanks for your help.
                  >Gary
                  >
                  >"Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
                  >news:4y3GH$j4I HA.1624@TK2MSFT NGHUB02.phx.gbl ...
                  >Hi Gary,
                  >>
                  >After some further research, I've figured out the problem.
                  >>
                  >Actually, we've made a mistake when locating the "PreviousButton " on the
                  >last step(the finish step). We originally use the following code:
                  >>
                  >============
                  >Control ctrl =
                  >Wizard1.FindCo ntrol("StepNavi gationTemplateC ontainerID");
                  > Button myPrevButton =
                  >(Button)ctrl.F indControl("Ste pPreviousButton ");
                  > myPrevButton.Vi sible = false;
                  >>
                  >============
                  >>
                  >this is ok for intermediate step, however, for the finish step/end step,
                  >you need to search for the "previousButton " in a different Container
                  >called
                  >"FinishNavigat ionTemplateCont ainerID", also the Button ID is different.
                  >Here is the code I've used to make the "previous button" in last step
                  >disabled. The code contains two part:
                  >>
                  >1. mark a flag(in session) indicate that we've reach the end
                  >>
                  >2. in "PreRender" event of the wizard, we check the flag and determine
                  >whether to disable the button
                  >>
                  >>
                  >============== ===========
                  >protected void WizardStep4_Act ivate(object sender, EventArgs e)
                  > {
                  > ............... .......
                  >>
                  > Session["finish"] = true;
                  >>
                  > }
                  >>
                  >============== ============
                  >>
                  >protected void Wizard1_PreRend er(object sender, EventArgs e)
                  > {
                  > if (Session["finish"] != null)
                  > {
                  > Control ctrl =
                  >Wizard1.FindCo ntrol("FinishNa vigationTemplat eContainerID");
                  > Button myPrevButton =
                  >(Button)ctrl.F indControl("Fin ishPreviousButt on");
                  > myPrevButton.En abled = false;
                  > }
                  >>
                  >>

                  Comment

                  Working...