p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 4 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=560)
-   -   chapter 4 there is problem (http://p2p.wrox.com/showthread.php?t=94552)

SHOOGN May 28th, 2015 03:42 AM

chapter 4 there is problem
 
the wizard tool to create easy-to use forms
the code dose not execute never

Imar May 28th, 2015 06:42 AM

Which exercise are you referring to? Can you provide (a lot) more information?

Imar

SHOOGN May 29th, 2015 01:08 PM

In chapter 4 magic with the wizard control
What is wizard_finshbutton
I cannot execute the codebehinde in VB

Imar May 30th, 2015 11:20 AM

Can you post the code for the ASPX and its code behind?

Cheers,

Imar

SHOOGN May 31st, 2015 03:20 AM

HTML Code
Code:

<asp:Wizard ID="Wizard1" runat="server" Width="500px" ActiveStepIndex="0">
                <WizardSteps>
                    <asp:WizardStep runat="server" title="About You">
                        <asp:Label ID="Label1" runat="server" Text="Type your name"></asp:Label>
                        <asp:TextBox ID="YourName" runat="server"></asp:TextBox>
                    </asp:WizardStep>
                    <asp:WizardStep runat="server" title="Favorite language" StepType="Finish">
                        <asp:DropDownList ID="FavoriteLanguage" runat="server">
                            <asp:ListItem>C#</asp:ListItem>
                            <asp:ListItem>Visual basic</asp:ListItem>
                            <asp:ListItem>Css</asp:ListItem>
                        </asp:DropDownList>
                    </asp:WizardStep>
                    <asp:WizardStep runat="server" StepType="Complete" Title="Ready">
                        <asp:Label ID="Result" runat="server" Text="Label"></asp:Label>
                    </asp:WizardStep>
                </WizardSteps>
            </asp:Wizard>



And this is code behind
Code:

Result.Text = "Your Name is" & YourName.Text
        Result.Text &= "<br /> Yore Favorite Language is"
        FavoriteLanguage.SelectedValue



Thank you for your response

Imar June 8th, 2015 10:57 AM

Can you post the *full* code for the Code Behind?

Imar

SHOOGN June 10th, 2015 05:39 AM

This is full code behind:
Code:

Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Result.FinishButtonClick, Wizard1.FinishButtonClick
     
        Result.Text = "Your Name is" & YourName.Text
        Result.Text &= "<br /> Yore Favorite Language is"
        FavoriteLanguage.SelectedValue

There is two blue underlines in
FinishButtonClick ,and FavoriteLanguage.SelectedValue

Imar June 10th, 2015 06:04 AM

Hi again,

I can see two issues with your code:

1. This:

Handles Result.FinishButtonClick, Wizard1.FinishButtonClick

should be:

Handles Wizard1.FinishButtonClick

as the method only handle's the Wizard1's FinishButtonClick event.

2. You're missing an ampersand when concatenating the values. This:

Result.Text &= "<br /> Yore Favorite Language is"
FavoriteLanguage.SelectedValue

should be:

Result.Text &= "<br /> Yore Favorite Language is" &
FavoriteLanguage.SelectedValue

Hope this helps,

Imar

SHOOGN June 22nd, 2015 06:29 AM

Thanks a lot
now It work nicely


All times are GMT -4. The time now is 08:18 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.