Wrap Wizard around a FormView?

J

Jim

I have a FormView aspx page that is used for inserting and editing. By
default, the FormView is a record listing of all the elements down the
page. What I want to do is break up the record items into steps using the
Wizard.

For example, right now I have the Wizard and FormView code:

-- Start Wizard Code --
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0"
FinishDestinationPageUrl="~/ZCAdmin/ProducerList.aspx">
<WizardSteps>
<asp:WizardStep runat="server" title="Local">
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Address">
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Information">
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Final">
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
-- End Wizard Code --

-- Start FormView Code --
<asp:FormView ID="FormView1" runat="server" DataKeyNames="ProducerID"
DataSourceID="sqlProducersFV">
<EditItemTemplate>
ProducerCountryID:
<asp:Label ID="ProducerCountryIDLabel" runat="server"
Text='<%# Bind("ProducerCountryID") %>' />
<br />
ProducerStateID:
<asp:Label ID="ProducerStateIDLabel" runat="server"
Text='<%# Bind("ProducerStateID") %>' />
<br />
ProducerCityID:
<asp:Label ID="ProducerCityIDLabel" runat="server"
Text='<%# Bind("ProducerCityID") %>' />
<br />
ProducerName:
<asp:Label ID="ProducerNameLabel" runat="server"
Text='<%# Bind("ProducerName") %>' />
<br />
ProducerStreetAddress:
<asp:Label ID="ProducerStreetAddressLabel" runat="server"
Text='<%# Bind("ProducerStreetAddress") %>' />
<br />
ProducerZipCode:
<asp:Label ID="ProducerZipCodeLabel" runat="server"
Text='<%# Bind("ProducerZipCode") %>' />
<br />
ProducerInfo:
<asp:Label ID="ProducerInfoLabel" runat="server"
Text='<%# Bind("ProducerInfo") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server"
CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel"
/>
</EditItemTemplate>

-- End Form View Code --

My objective is to combine the two so it would be like the following (I know
the following code doesnt' work, but it gives an example of what I'm after):

-- Start Final Code --
<asp:FormView ID="FormView1" runat="server" DataKeyNames="ProducerID"
DataSourceID="sqlProducersFV">
<EditItemTemplate>
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0"
FinishDestinationPageUrl="~/ZCAdmin/ProducerList.aspx">
<WizardSteps>
<asp:WizardStep runat="server" title="Local">
ProducerCountryID:
<asp:Label ID="ProducerCountryIDLabel" runat="server"
Text='<%# Bind("ProducerCountryID") %>' />
<br />
ProducerStateID:
<asp:Label ID="ProducerStateIDLabel" runat="server"
Text='<%# Bind("ProducerStateID") %>' />
<br />
ProducerCityID:
<asp:Label ID="ProducerCityIDLabel" runat="server"
Text='<%# Bind("ProducerCityID") %>' />
<br />
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Address">
ProducerName:
<asp:Label ID="ProducerNameLabel" runat="server"
Text='<%# Bind("ProducerName") %>' />
<br />
ProducerStreetAddress:
<asp:Label ID="ProducerStreetAddressLabel" runat="server"
Text='<%# Bind("ProducerStreetAddress") %>' />
<br />
ProducerZipCode:
<asp:Label ID="ProducerZipCodeLabel" runat="server"
Text='<%# Bind("ProducerZipCode") %>' />
<br />
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Information">
ProducerInfo:
<asp:Label ID="ProducerInfoLabel" runat="server"
Text='<%# Bind("ProducerInfo") %>' />
<br />
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
<asp:LinkButton ID="UpdateButton" runat="server"
CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
</asp:FormView>
-- End Final Code --

How do I need to design my page to make FormView split up w/ a Wizard?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,913
Messages
2,570,027
Members
46,419
Latest member
businessfunding

Latest Threads

Top