Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   DeveloperBarn Forums > Programming & Scripting > .Net Development

Sponsored Links

Discuss "Wizard1 error The command 'MoveComplete' is not valid" in the .Net Development forum.

.Net Development - Learn about the Microsoft.Net framework and how to create powerful web-based (ASP.net) and client-based (Windows Forms) applications utilizing various languages such as C#, VB.Net, J# and others.


Closed Thread
 
LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1  
Old April 27th, 2008, 11:26 AM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 194
Thanks: 16
Thanked 0 Times in 0 Posts
Rep Power: 1
peebman2000 is an unknown quantity at this point
Question Wizard1 error The command 'MoveComplete' is not valid

Hey everyone is Peebman, i'm still practicing on this questionaire this weekend. Using the wizard control. Again building a questionaire app is new for me.

So below is my code, what i'm have a main page to allow the user to enter the questionaire or survey. They go through the survery and if they hit the "SAVE" button (which is the cancel button, im' just using it to save the users step if they want to come back and finish the survey later); their step is stored in sql database along with their answers to the survery and they are sent back to the main page.

When they log back in and they enter the survery from the main page, I have a sql reader code in the page upload to find the users last step in the survey. It displays the user last step and the user is able to hit the "next" button to go to the next step.

But my problem is the "finish" button. The finish button is suppose to send the user to the complete page in the wizard. But since the user is started at the last step and they hit the "Finish" button I get this error:

Quote:
Server Error in '/questionaire' Application.
--------------------------------------------------------------------------------

The command 'MoveComplete' is not valid for the previous step, make sure the step type is not changed between postbacks.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The command 'MoveComplete' is not valid for the previous step, make sure the step type is not changed between postbacks.
I don't know why I get this error, but I know it has to do something with me starting the user at its last saved step.

I tried useing the Wizard1_FinishButtonClick to send the user to the complete page, but I still get the error.

I only have 4 steps 0-3.

Does anyone know why I get this error and what can I do to get the finish click to work?

I appreciate any help and ideas. I won't be able to response until around 5pm est time, i'll be out looking for a home and will come back to finish the survey app, but again thanks for any help. Talk to everyone later.

survey.aspx.vb:
Code:
Imports System.Data.SqlClient
Imports System.Web.Configuration
Imports System.IO
Imports System.Text
Imports System.IO.stream
Imports System.data
Imports System.Net.Mail
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.UserControl
Imports System.Web.UI.WebControls
Imports System.Web.Management
Imports System.Diagnostics.Process
Partial Class wizard
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Dim value As WizardStepBase
        Dim value As String

        value = Wizard1.ActiveStepIndex.ToString



        'Dim s As Integer

        Dim datacommand As New SqlCommand
        Dim Reader As SqlDataReader
        datacommand.Connection = New SqlConnection(ConfigurationManager.ConnectionStrings("peebman").ToString)
        datacommand.Connection.Open()
        datacommand.CommandText = "Select title, spec, description, training, name, agency, step from wizard where user_name = '" & User.Identity.Name & "'"


        'datacommand.Parameters.AddWithValue("@ID", CType(txtid.Text, Int32))
        Reader = datacommand.ExecuteReader()
        If Reader.Read() Then
            'Response.Write(Reader("step").ToString)
            'Response.End()
            txttitle.Text = Reader("title").ToString
            txtspec.Text = Reader("spec").ToString
            txtdesc.Text = Reader("description").ToString
            txttrain.Text = Reader("training").ToString
            txtname.Text = Reader("name").ToString
            txtagency.Text = Reader("agency").ToString
            value = Reader("step").ToString


            'TextBox12.Text = Reader("date_updated").ToString()
            'Else

            'TextBox12.Text = "no data"
        End If
        'value = s
        Reader.Close()
        datacommand.Connection.Close()
        'Response.Write(value)
        'Response.End()
        Wizard1.ActiveStepIndex = value




    End Sub

    Protected Sub Wizard1_CancelButtonClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Wizard1.CancelButtonClick
        Dim dataadapter As SqlDataAdapter
        Dim datacommand As SqlCommand
        dataadapter = New SqlDataAdapter
        datacommand = New SqlCommand

        datacommand.CommandText = ("sp_wizardupdate")
        datacommand.Connection = New SqlConnection(ConfigurationManager.ConnectionStrings("peebman").ToString)
        dataadapter = New SqlDataAdapter("sp_wizardupdate", datacommand.Connection)
        datacommand.CommandType = Data.CommandType.StoredProcedure

        datacommand.Parameters.Add("@user_name", SqlDbType.VarChar, 50).Value = User.Identity.Name

        datacommand.Parameters.Add("@title", SqlDbType.VarChar, 50).Value = txttitle.Text

        datacommand.Parameters.Add("@spec", SqlDbType.VarChar, 50).Value = txtspec.Text

        datacommand.Parameters.Add("@description", SqlDbType.Text).Value = txtdesc.Text

        datacommand.Parameters.Add("@training", SqlDbType.Text).Value = txttrain.Text

        datacommand.Parameters.Add("@name", SqlDbType.VarChar, 50).Value = txtname.Text

        datacommand.Parameters.Add("@agency", SqlDbType.VarChar, 50).Value = txtagency.Text

        datacommand.Parameters.Add("@step", SqlDbType.Text).Value = Wizard1.ActiveStepIndex.ToString


        datacommand.Parameters.Add("@time", SqlDbType.DateTime).Value = Date.Now


        datacommand.Connection.Open()
        Try
            datacommand.ExecuteNonQuery()
        Catch ex As Exception
            Response.Write(ex.Message.ToString())

        End Try
        datacommand.Connection.Close()

        Server.Transfer("wizardmain.aspx")

    End Sub

    Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick
        
        Wizard1.ActiveStepIndex = 3


    End Sub
End Class
Sponsored Links
  #2  
Old April 27th, 2008, 11:49 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

What line does the error occur on? You may want to look into using the Wizard control's MoveTo method: Wizard.MoveTo Method (System.Web.UI.WebControls)

Hope this helps.
__________________
jmurrayhead
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

If you like it here...throw us a few bones to help
support us.

Join our Folding team: DeveloperBarn Folding

  #3  
Old April 28th, 2008, 08:35 AM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 194
Thanks: 16
Thanked 0 Times in 0 Posts
Rep Power: 1
peebman2000 is an unknown quantity at this point
Question reply

Thanks for the reply Jmurrayhead, I tried playing with the moveto method and its not working. I store the activestep in sql as "2". You can see that code under the Button click event as datacommand.Parameters.Add("@step", SqlDbType.Text).Value = Wizard1.ActiveStepIndex.ToString.

Just using this as an example, the user last step was 2. So i'm trying to use the moveto(wizardstep), but I get error at wizardstep = Reader("step")
that says:
Quote:
unable to cast object system.string to system.web.ui.wizardstepbase
I tried doing the tostring method, but is still didn't work. Any Ideas how I can get around this.

Thanks.

asp.vb code:
Code:
Partial Class wizard
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Dim value As WizardStepBase
        'Dim value As String
        'Dim instance As wizard
        Dim wizardstep As WizardStepBase = Nothing

        'value = Wizard1.ActiveStepIndex.ToString



        'Dim s As Integer

        Dim datacommand As New SqlCommand
        Dim Reader As SqlDataReader
        datacommand.Connection = New SqlConnection(ConfigurationManager.ConnectionStrings("dave").ToString)
        datacommand.Connection.Open()
        datacommand.CommandText = "Select title, spec, description, training, name, agency, step from wizard where user_name = '" & User.Identity.Name & "'"


        'datacommand.Parameters.AddWithValue("@ID", CType(txtid.Text, Int32))
        Reader = datacommand.ExecuteReader()
        If Reader.Read() Then
            'Response.Write(Reader("step").ToString)
            'Response.End()
            txttitle.Text = Reader("title").ToString
            txtspec.Text = Reader("spec").ToString
            txtdesc.Text = Reader("description").ToString
            txttrain.Text = Reader("training").ToString
            txtname.Text = Reader("name").ToString
            txtagency.Text = Reader("agency").ToString
            wizardstep = Reader("step")



            'TextBox12.Text = Reader("date_updated").ToString()
            'Else

            'TextBox12.Text = "no data"
        End If
        'value = s
        Reader.Close()
        datacommand.Connection.Close()
        'Response.Write(value)
        'Response.End()
        'Wizard1.ActiveStepIndex = value

        Wizard1.MoveTo(wizardstep)


        'If value = "2" Then
        '    Wizard1.MoveTo(wizardstep2)

        'End If


    End Sub

    Protected Sub Wizard1_CancelButtonClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Wizard1.CancelButtonClick
        Dim dataadapter As SqlDataAdapter
        Dim datacommand As SqlCommand
        dataadapter = New SqlDataAdapter
        datacommand = New SqlCommand

        datacommand.CommandText = ("sp_wizardupdate")
        datacommand.Connection = New SqlConnection(ConfigurationManager.ConnectionStrings("dave").ToString)
        dataadapter = New SqlDataAdapter("sp_wizardupdate", datacommand.Connection)
        datacommand.CommandType = Data.CommandType.StoredProcedure

        datacommand.Parameters.Add("@user_name", SqlDbType.VarChar, 50).Value = User.Identity.Name

        datacommand.Parameters.Add("@title", SqlDbType.VarChar, 50).Value = txttitle.Text

        datacommand.Parameters.Add("@spec", SqlDbType.VarChar, 50).Value = txtspec.Text

        datacommand.Parameters.Add("@description", SqlDbType.Text).Value = txtdesc.Text

        datacommand.Parameters.Add("@training", SqlDbType.Text).Value = txttrain.Text

        datacommand.Parameters.Add("@name", SqlDbType.VarChar, 50).Value = txtname.Text

        datacommand.Parameters.Add("@agency", SqlDbType.VarChar, 50).Value = txtagency.Text

        datacommand.Parameters.Add("@step", SqlDbType.Text).Value = Wizard1.ActiveStepIndex.ToString


        datacommand.Parameters.Add("@time", SqlDbType.DateTime).Value = Date.Now


        datacommand.Connection.Open()
        Try
            datacommand.ExecuteNonQuery()
        Catch ex As Exception
            Response.Write(ex.Message.ToString())

        End Try
        datacommand.Connection.Close()

        Server.Transfer("wizardmain.aspx")

    End Sub

    Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick
        
        Wizard1.ActiveStepIndex = 3


    End Sub
End Class


Quote:
Originally Posted by jmurrayhead View Post
What line does the error occur on? You may want to look into using the Wizard control's MoveTo method: Wizard.MoveTo Method (System.Web.UI.WebControls)

Hope this helps.
  #4  
Old April 28th, 2008, 08:44 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

Unfortunately, I don't think you can directly create an instance of the WizardStepBase class like that.

Since you only have 4 items, I would just use a Select Case structure to move the user to the appropriate form based off the value in your reader:

Code:
Select Case reader("step")
           Case 0
               Wizard1.MoveTo(Me.WizardStep0)
           Case 1
               Wizard1.MoveTo(Me.WizardStep1)
           Case 2
               Wizard1.MoveTo(Me.WizardStep2)
           Case 3
                Wizard1.MoveTo(Me.WizardStep3)
           Case Else
                Wizard1.MoveTo(Me.WizardStep0)
End Select
  #5  
Old April 28th, 2008, 10:08 AM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 194
Thanks: 16
Thanked 0 Times in 0 Posts
Rep Power: 1
peebman2000 is an unknown quantity at this point
Talking reply

Hey thanks jmurrayhead, I just got back from the meeting with the client for the questionaire app, i'm at work now. The code I posted was code I did at home. I'll recreate it today at work and try that solution. I'll let you know later today if it worked or not.

Thanks again


Quote:
Originally Posted by jmurrayhead View Post
Unfortunately, I don't think you can directly create an instance of the WizardStepBase class like that.

Since you only have 4 items, I would just use a Select Case structure to move the user to the appropriate form based off the value in your reader:

Code:
Select Case reader("step")
           Case 0
               Wizard1.MoveTo(Me.WizardStep0)
           Case 1
               Wizard1.MoveTo(Me.WizardStep1)
           Case 2
               Wizard1.MoveTo(Me.WizardStep2)
           Case 3
                Wizard1.MoveTo(Me.WizardStep3)
           Case Else
                Wizard1.MoveTo(Me.WizardStep0)
End Select
  #6  
Old April 28th, 2008, 01:17 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 194
Thanks: 16
Thanked 0 Times in 0 Posts
Rep Power: 1
peebman2000 is an unknown quantity at this point
Question reply

Hey jmurrayhead I tried your solutions and i'm still getting an error when the user logs back in after saving the infor and step they were in. They start at their saved step and hit the finish button and get this error:

Quote:
Server Error in '/Csharp' Application.
--------------------------------------------------------------------------------

The command 'MoveComplete' is not valid for the previous step, make sure the step type is not changed between postbacks.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The command 'MoveComplete' is not valid for the previous step, make sure the step type is not changed between postbacks.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidOperationException: The command 'MoveComplete' is not valid for the previous step, make sure the step type is not changed between postbacks.]
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Obj ect source, EventArgs e) +1703090
System.Web.UI.WebControls.WizardChildTable.OnBubbl eEvent(Object source, EventArgs args) +17
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(Command EventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +163
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
It doesn't specify a line that generating this. I don't understand why this movecomplete error keeps comeing up when the finish button is clicked. I'm still searching things online, but do you have any idea why i'm getting the error?

Thanks again.

aspx page:
Code:
<asp:LoginName ID="LoginName1" runat="server" />
        <asp:Wizard ID="Wizard1" runat="server" Height="157px" Style="z-index: 100; left: 226px;
            position: absolute; top: 111px" Width="366px" BackColor="#F7F6F3" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" CancelButtonText="Save" DisplayCancelButton="True" ActiveStepIndex="1">
            <WizardSteps>
                <asp:WizardStep ID=WizardStep0 runat="server">
                <table>
                        <tr>
                            <td style="width: 92px">
                                Job title:</td>
                            <td style="width: 101px">
                                <asp:TextBox ID="txttitle" runat="server"></asp:TextBox>
                            </td>
                            <td style="width: 98px">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 92px">
                                Job Spec:</td>
                            <td style="width: 101px">
                            <asp:TextBox ID="txtspec" runat="server"></asp:TextBox>
                            </td>
                            <td style="width: 98px">
                                
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 92px">
                            </td>
                            <td style="width: 101px">
                            </td>
                            <td style="width: 98px">
                            </td>
                        </tr>
                    </table>
                </asp:WizardStep>
                <asp:WizardStep ID=WizardStep1 runat="server">
                <table>
                        <tr>
                            <td style="width: 92px">
                                Job description:</td>
                            <td style="width: 101px">
                                <asp:TextBox ID="txtdesc" runat="server" TextMode="MultiLine"></asp:TextBox>
                            </td>
                            <td style="width: 98px">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 92px">
                                Job training:</td>
                            <td style="width: 101px">
                            <asp:TextBox ID="txttrain" runat="server" TextMode="MultiLine"></asp:TextBox>
                            </td>
                            <td style="width: 98px">
                                
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 92px">
                            </td>
                            <td style="width: 101px">
                            </td>
                            <td style="width: 98px">
                            </td>
                        </tr>
                    </table>
                </asp:WizardStep>
                <asp:WizardStep ID=WizardStep2 runat="server" StepType="Finish">
                <table>
                        <tr>
                            <td style="width: 92px">
                                Name:</td>
                            <td style="width: 101px">
                                <asp:TextBox ID="txtname" runat="server"></asp:TextBox>
                            </td>
                            <td style="width: 98px">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 92px">
                                Agency:</td>
                            <td style="width: 101px">
                            <asp:TextBox ID="txtagency" runat="server"></asp:TextBox>
                            </td>
                            <td style="width: 98px">
                                
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 92px">
                            </td>
                            <td style="width: 101px">
                            </td>
                            <td style="width: 98px">
                            </td>
                        </tr>
                    </table>
                </asp:WizardStep>
                <asp:WizardStep ID=WizardStep3 runat="server" StepType="Complete">
                <asp:Label ID="Label1" runat="server" Text="You have completed survey" ForeColor="Red" Width="264px"></asp:Label>
                </asp:WizardStep>
            </WizardSteps>
            <StepStyle BorderWidth="0px" ForeColor="#5D7B9D" VerticalAlign="Top" />
            <SideBarButtonStyle BorderWidth="0px" Font-Names="Verdana" ForeColor="White" BackColor="#F7F6F3" />
            <NavigationButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
                BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284775" />
            <SideBarStyle BackColor="#F7F6F3" BorderWidth="0px" Font-Size="0.9em" VerticalAlign="Top"
                Width="1px" />
            <HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" Font-Size="0.9em"
                ForeColor="White" HorizontalAlign="Left" />
            <NavigationStyle BackColor="#F7F6F3" />
        </asp:Wizard>

updated aspx.vb code:
Code:
Partial Class questionaire
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Dim value As WizardStepBase
        Dim value As String
        'Dim instance As wizard
        'Dim wizardstep As WizardStepBase

        value = Wizard1.ActiveStepIndex.ToString



        Dim datacommand As New SqlCommand
        Dim Reader As SqlDataReader
        datacommand.Connection = New SqlConnection(ConfigurationManager.ConnectionStrings("dave").ToString)
        datacommand.Connection.Open()
        datacommand.CommandText = "Select title, spec, description, training, name, agency, step from wizard where user_name = '" & User.Identity.Name & "'"


        'datacommand.Parameters.AddWithValue("@ID", CType(txtid.Text, Int32))
        Reader = datacommand.ExecuteReader()
        If Reader.Read() Then
            'Response.Write(Reader("step").ToString)
            'Response.End()
            txttitle.Text = Reader("title").ToString
            txtspec.Text = Reader("spec").ToString
            txtdesc.Text = Reader("description").ToString
            txttrain.Text = Reader("training").ToString
            txtname.Text = Reader("name").ToString
            txtagency.Text = Reader("agency").ToString
            value = Reader("step")



            'TextBox12.Text = Reader("date_updated").ToString()
            'Else

            'TextBox12.Text = "no data"
        End If
        'value = s
        Reader.Close()
        datacommand.Connection.Close()
        'Response.Write(value)
        'Response.End()
        'Wizard1.ActiveStepIndex = value
        If value = 0 Then
            Wizard1.MoveTo(Me.WizardStep0)
        ElseIf value = 1 Then
            Wizard1.MoveTo(Me.WizardStep1)
        ElseIf value = 2 Then
            Wizard1.MoveTo(Me.WizardStep2)
        Else
            Wizard1.MoveTo(Me.WizardStep0)
        End If



        'If value = "2" Then
        '    Wizard1.MoveTo(wizardstep2)

        'End If
    End Sub

    Protected Sub Wizard1_CancelButtonClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Wizard1.CancelButtonClick
        Dim dataadapter As SqlDataAdapter
        Dim datacommand As SqlCommand
        dataadapter = New SqlDataAdapter
        datacommand = New SqlCommand

        datacommand.CommandText = ("sp_wizardupdate")
        datacommand.Connection = New SqlConnection(ConfigurationManager.ConnectionStrings("dave").ToString)
        dataadapter = New SqlDataAdapter("sp_wizardupdate", datacommand.Connection)
        datacommand.CommandType = Data.CommandType.StoredProcedure

        datacommand.Parameters.Add("@user_name", SqlDbType.VarChar, 50).Value = User.Identity.Name

        datacommand.Parameters.Add("@title", SqlDbType.VarChar, 50).Value = txttitle.Text

        datacommand.Parameters.Add("@spec", SqlDbType.VarChar, 50).Value = txtspec.Text

        datacommand.Parameters.Add("@description", SqlDbType.Text).Value = txtdesc.Text

        datacommand.Parameters.Add("@training", SqlDbType.Text).Value = txttrain.Text

        datacommand.Parameters.Add("@name", SqlDbType.VarChar, 50).Value = txtname.Text

        datacommand.Parameters.Add("@agency", SqlDbType.VarChar, 50).Value = txtagency.Text

        datacommand.Parameters.Add("@step", SqlDbType.Text).Value = Wizard1.ActiveStepIndex.ToString


        datacommand.Parameters.Add("@time", SqlDbType.DateTime).Value = Date.Now


        datacommand.Connection.Open()
        Try
            datacommand.ExecuteNonQuery()
        Catch ex As Exception
            Response.Write(ex.Message.ToString())

        End Try
        datacommand.Connection.Close()

        Server.Transfer("questionmain.aspx")
    End Sub

    Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick
        Response.Write("its suppose to work")
        Response.End()

        Wizard1.MoveTo(Me.WizardStep3)

    End Sub

    Protected Sub Wizard1_PreviousButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.PreviousButtonClick
        If Wizard1.ActiveStepIndex = 1 Then
            Wizard1.MoveTo(Me.WizardStep0)
        ElseIf Wizard1.ActiveStepIndex = 2 Then
            Wizard1.MoveTo(Me.WizardStep1)
        ElseIf Wizard1.ActiveStepIndex = 3 Then
            Wizard1.MoveTo(Me.WizardStep2)
        End If
    End Sub

    Protected Sub Wizard1_NextButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.NextButtonClick
        If Wizard1.ActiveStepIndex = 0 Then
            Wizard1.MoveTo(Me.WizardStep1)
        ElseIf Wizard1.ActiveStepIndex = 1 Then
            Wizard1.MoveTo(Me.WizardStep2)
        ElseIf Wizard1.ActiveStepIndex = 2 Then
            Wizard1.MoveTo(Me.WizardStep3)
        End If
    End Sub
End Class

Quote:
Originally Posted by jmurrayhead View Post
Unfortunately, I don't think you can directly create an instance of the WizardStepBase class like that.

Since you only have 4 items, I would just use a Select Case structure to move the user to the appropriate form based off the value in your reader:

Code:
Select Case reader("step")
           Case 0
               Wizard1.MoveTo(Me.WizardStep0)
           Case 1
               Wizard1.MoveTo(Me.WizardStep1)
           Case 2
               Wizard1.MoveTo(Me.WizardStep2)
           Case 3
                Wizard1.MoveTo(Me.WizardStep3)
           Case Else
                Wizard1.MoveTo(Me.WizardStep0)
End Select
  #7  
Old April 28th, 2008, 01:51 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

I'm not sure what the problem is, exactly. I've done some research and there isn't much information regarding this error, either.

Sometimes the built-in .Net controls are wonderful, other times they are not. During these other times, I usually choose to build my own control that does what I expect In your case, you could simply use a series of panels that you could show/hide depending on the "step" the user is on.
  #8  
Old April 28th, 2008, 02:30 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 194
Thanks: 16
Thanked 0 Times in 0 Posts
Rep Power: 1
peebman2000 is an unknown quantity at this point
Question reply

Hey thanks jmurrayhead, thats sucks about the wizard control, I couldn't find anything on the error either. I like your idea about the panels, i'm toying with that now, but I need the panels to be aligned on the page. Below I have 2 panels, so when I hide and show either panel, you see the text which back and fourth in different areas of the page depending on which is hiden and which is visable.

Is there a way i can keep the panels aligned so that the text stays in the same spots in all of the panels when the user moves to the next panel?

You know what i'm trying to say or am I as usual sounding like a real amateur.

aspx page:
Code:
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Panel ID="Panel1" runat="server" Height="105px" Style="z-index: 100; left: 261px;
            position: absolute; top: 100px" Width="243px">
            david davide<asp:Button ID="Button1" runat="server" Text="Button" />
            </asp:Panel>
        &nbsp;
        <asp:Panel ID="Panel2" runat="server" Height="69px" Width="231px" style="z-index: 102; left: 260px; position: absolute; top: 214px" Visible="False">
        next step<asp:Button ID="Button2" runat="server" Text="Button" />
        </asp:Panel>
    
    </div>
    </form>
</body>
aspx.vb code:
Code:
Partial Class questpanal
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Panel1.Visible = False

        Panel2.Visible = True


    End Sub

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        Panel1.Visible = True

        Panel2.Visible = False
    End Sub
End Class

Quote:
Originally Posted by jmurrayhead View Post
I'm not sure what the problem is, exactly. I've done some research and there isn't much information regarding this error, either.

Sometimes the built-in .Net controls are wonderful, other times they are not. During these other times, I usually choose to build my own control that does what I expect In your case, you could simply use a series of panels that you could show/hide depending on the "step" the user is on.
  #9  
Old April 28th, 2008, 02:39 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

That appears to be an issue with the CSS styling. From the looks of it, you have assigned different widths and such to the two panels. That would certainly cause the shifting of the text.
  #10  
Old April 28th, 2008, 02:49 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 194
Thanks: 16
Thanked 0 Times in 0 Posts
Rep Power: 1
peebman2000 is an unknown quantity at this point
Thumbs up reply

Okay I see what you're saying, I made both panels the same width and height, and they overlap each other. Which I kind of don't like, but I have a month to finish this app, so I'm rolling with this.

aspx page:
Code:
<div>
        <asp:Panel ID="Panel1" runat="server" Height="105px" Style="z-index: 100; left: 261px;
            position: absolute; top: 100px" Width="243px">
            david davide<asp:Button ID="Button1" runat="server" Text="Button" />
            </asp:Panel>
        &nbsp;
        <asp:Panel ID="Panel2" runat="server" Height="69px" Width="231px" style="z-index: 100; left: 261px; position: absolute; top: 100px" Visible="False">
        next step<asp:Button ID="Button2" runat="server" Text="Button" />
        </asp:Panel>
    
    </div>
Thanks again for your help jmurray, I appreciate it very much.

Thanks.

Quote:
Originally Posted by jmurrayhead View Post
That appears to be an issue with the CSS styling. From the looks of it, you have assigned different widths and such to the two panels. That would certainly cause the shifting of the text.
Closed Thread

  DeveloperBarn Forums > Programming & Scripting > .Net Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.developerbarn.com/net-development/155-wizard1-error-command-movecomplete-not-valid.html
Posted By For Type Date
Wizard1 error The command 'MoveComplete' is not valid - ASP.Net Development This thread Refback April 28th, 2008 08:26 AM


All times are GMT -4. The time now is 09:34 AM.



Content Relevant URLs by vBSEO 3.2.0