View Single Post
  #1 (permalink)  
Old June 4th, 2008, 07:28 PM
AspNetGuy AspNetGuy is offline
Authorized User
 
Join Date: Apr 2008
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to AspNetGuy
Default ASP Wizard on Master Page

When I take a very simple example of a Wizard control which works on a non-master page and move the control to a page using a master page it cesases to work as follows:

If I have three steps, I can click the NEXT button on step 1 and move to STEP2. When I click on the NEXT button on the step 2 page the control remains on the current page.

If I click the PREVIOUS button on page 2 I get the following message:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorExceptio n: The command 'MovePrevious' is not valid for the previous step, make sure the step type is not changed between postbacks.


My master page is effectively the same as from Beginning ASP 3.5.

Any help would be greatly appreciated.

I have seen several references on the web to this message but no one has proposed a solution other than looking at the code behind file.

For this page there is no code in the code behind file. The BasePage code follows:

using System;
using System.Web;


/// <summary>
/// Summary description for BasePage
/// </summary>
public class BasePage : System.Web.UI.Page
{
    private void Page_PreRender(object sender, EventArgs e)
    {
        if (this.Title == "Untitled Page")
        {
            throw new Exception("Page title cannot be \"Untitled Page\".");
        }

    }
    private void Page_PreInit(object sender, EventArgs e)
    {
        HttpCookie preferredTheme = Request.Cookies.Get("PreferredTheme");


        /* Obtain the URL.Segments for the current page*/
        string[] segments = Request.Url.Segments;

        /*--------------------------------------------------------------------*/
        /* Loop through the segments looking for "Security/". If found then */
        /* the user is requesting a page from the Security directory. We will*/
        /* always use the "Security" theme for those pages. */
        /*--------------------------------------------------------------------*/
        int i = 0;
        while (i < segments.Length && !segments[i].Equals("Security/"))
        {
            i++;
        }
        if (i < segments.Length)
        {
            Page.Theme = "Security";
            //if (preferredTheme != null)
            //{
            // preferredTheme.Value = "Security";
            //}
        }
        else
        {
           // if (preferredTheme != null)
           // {
               // if (preferredTheme.Value == "DarkGrey")
               // {
               // preferredTheme.Value = "TFL";
               // }
               Page.Theme = "TFL";
           // }
        }

    }
    public BasePage()
    {
        this.PreRender += new EventHandler(Page_PreRender);
        this.PreInit += new EventHandler(Page_PreInit);
    }
}


Reply With Quote