Asp.net Multiview & Wizard
Multi View& Wizard
Multi view usage
Aspx Code
<asp:MultiViewrunat="server" ID="mvTest"ActiveViewIndex="0">
<asp:Viewrunat="server" ID="firstView">
<span>step 1.</span>
</asp:View>
<asp:ViewID="secondView" runat="server" >
<span>step 2.</span>
</asp:View>
<asp:ViewID="thirdView" runat="server">
<span>step 3.</span>
</asp:View>
<asp:ViewID="forthView" runat="server">
<span>finished.</span>
</asp:View>
</asp:MultiView>
<div>
<asp:Buttonrunat="server" ID="btnPre" CommandName="PrevView"Text="Back" OnClick="btnPre_Click"/>
<asp:Button runat="server"ID="btnNext" Text="Next" CommandName="NextView"OnClick="btnNext_Click"/>
</div>
Code behind
private void ShowViewBtn()
{
btnPre.Visible =mvTest.ActiveViewIndex > 0;
btnNext.Visible =mvTest.ActiveViewIndex < mvTest.Views.Count - 1;
}
protected void btnPre_Click(objectsender, EventArgs e)
{
mvTest.SetActiveView(mvTest.Views[--mvTest.ActiveViewIndex]);
ShowViewBtn();
}
protected void btnNext_Click(objectsender, EventArgs e)
{
mvTest.SetActiveView(mvTest.Views[++mvTest.ActiveViewIndex]);
ShowViewBtn();
}
Wizard usage
Aspx code :
<asp:WizardID="wizardTest" runat="server" Width="467px"BackColor="#EFF3FB" BorderColor="#B5C7DE"
BorderWidth="1px"Height="500px" DisplayCancelButton="True"OnCancelButtonClick="wizardTest_Cancel"
OnFinishButtonClick="wizardTest_Finished"OnActiveStepChanged="wizardTest_ActiveStepChanged"
OnNextButtonClick="wizardTest_Next"OnPreviousButtonClick="wizardTest_Prev"OnSideBarButtonClick="wizardTest_SlideBtnClick">
<WizardSteps>
<asp:WizardStepID="WizardStep1" runat="server"Title="Personal">
<h3>
Personal Profile</h3>
Preferred Programming Language:
<asp:DropDownListID="lstLanguage" runat="server">
<asp:ListItem>C#</asp:ListItem>
<asp:ListItem>VB</asp:ListItem>
<asp:ListItem>J#</asp:ListItem>
<asp:ListItem>Java</asp:ListItem>
<asp:ListItem>C++</asp:ListItem>
<asp:ListItem>C</asp:ListItem>
</asp:DropDownList>
<br />
</asp:WizardStep>
<asp:WizardStepID="WizardStep2" runat="server" Title="Company"AllowReturn="False">
<h3>
Company Profile</h3>
Number of Employees:
<asp:TextBoxID="txtEmpCount" runat="server" />
Number of Locations:
<asp:TextBoxID="txtLocCount" runat="server" />
</asp:WizardStep>
<asp:WizardStepID="WizardStep3" runat="server"Title="Software">
<h3>
Software Profile</h3>
Licenses Required:
<asp:CheckBoxListID="lstTools" runat="server">
<asp:ListItem>VisualStudio 2008</asp:ListItem>
<asp:ListItem>Office2007</asp:ListItem>
<asp:ListItem>WindowsServer 2008</asp:ListItem>
<asp:ListItem>SQLServer 2008</asp:ListItem>
</asp:CheckBoxList>
</asp:WizardStep>
<asp:WizardStepID="Complete" runat="server" Title="Complete">
<br />
Thank you for completing thissurvey.<br />
Your products will be deliveredshortly.<br />
</asp:WizardStep>
</WizardSteps>
<StartNavigationTemplate>
<i>StartNavigationTemplate</i><br />
<asp:ButtonID="StartNextButton" runat="server"Font-Size="35" Text="Start"CommandName="MoveNext" />
</StartNavigationTemplate>
<StepNavigationTemplate>
<i>StepNavigationTemplate</i><br />
<asp:ButtonID="StepPreviousButton" runat="server"CausesValidation="False" CommandName="MovePrevious"
Text="Previous" />
<asp:ButtonID="StepNextButton" runat="server" Text="Next"CommandName="MoveNext" />
</StepNavigationTemplate>
<FinishNavigationTemplate>
<i>FinishNavigationTemplate</i><br />
<asp:ButtonID="FinishPreviousButton" runat="server" CausesValidation="False"Text="Previous"
CommandName="MovePrevious" />
<asp:ButtonID="FinishButton" Font-Size="35" runat="server"Text="Finish" CommandName="MoveComplete" />
</FinishNavigationTemplate>
</asp:Wizard>
Templates:
·HeaderTemplate Defines the content of the header region
·SideBarTemplate Defines the sidebar, which typically includes navigation links for each Step
·StartNavigationTemplate Defines the navigation buttons for the first step (when Step Type is Start)
·StepNavigationTemplate Defines the navigation buttons for intermediate steps (when StepType is Step)
·FinishNavigationTemplate Defines the navigation buttons for the final step (when StepType is Finish)
·LayoutTemplate Defines the overall arrangement of the header, sidebar, step area, and Navigation buttons.
Styles can set :
Header Style
Sidebar style
Sidebar button style
Step style
Navigation style
Navigation button style
Start next button style
Step next button style
Step previous buttonstyle
Finish previous buttonstyle
Cancel button style
相關文章
- SQL Database Maintenance WizardSQLDatabaseAINaN
- VS2005入門之ListBox、MultiView、PanelView
- doxygen/addon/doxywizard/wizard.cpp
- Tara Embedded Wizard 5.20 / 5.30 破解
- The JPEG Wizard 1.40破解 (4千字)
- Mac電腦好用的剪下板工具Paste Wizard 啟用最新版+Paste Wizard 啟用序列號MacAST
- djvu converter wizard(djvu格式轉換器)
- QuartusII呼叫 PLL_IP核方法(Mega Wizard)
- 開源文件管理系統 Wizard 1.2.1 釋出
- 開源文件管理系統 Wizard 1.2.3 釋出
- 開源文件管理系統 Wizard 1.2 釋出
- 開源文件管理系統 Wizard 1.2.6 釋出
- 開源文件管理系統 Wizard 1.2.5 釋出
- VS2005入門之Table、Wizard
- Wizard 開源文件管理系統1.0釋出啦
- Application Wizard for Mac應用程式快速啟動工具APPMac
- EaseUS Data Recovery Wizard Mac資料恢復軟體Mac資料恢復
- 🎩 JSON Wizard for Mac - 解析你的 JSON 資料!🔮JSONMac
- Table control wizard mutiply lines selection
- Quartus Ⅱ呼叫FIFO IP核方法實現求和(Mega Wizard)
- 基於 Laravel 的開源文件管理系統 Wizard 1.0.8 釋出了Laravel
- Paste Wizard for Mac(剪貼簿管理器) 13.0完整啟用版ASTMac
- 簡單好用的剪下板工具 Paste Wizard 啟用最新版AST
- An error occurred while the wizard was checking the current Windows product license. Error Code: 8:ErrorWhileWindows
- odoo wizard介面顯示帶核取方塊列表及勾選資料獲取Odoo
- Wizard Framework:一個自己開發的基於Windows Forms的嚮導開發框架FrameworkWindowsORM框架
- ASP.NET Core: 全新的ASP.NET !ASP.NET
- ASP.NET MVC與ASP.NET WebFormASP.NETMVCWebORM
- Forget asp.net membership,ASP.NET Identity OverviewASP.NETIDEView
- ASP.NET Core ----ASP.NET Core中使用Code FirstASP.NET
- ASP.NET 6.0 Core 遷移 ASP.NET Core 7.0ASP.NET
- ASP.NET AJAX 是ASP.NET 3.5 才引入的ASP.NET
- Asp.Net CacheASP.NET
- ASP.NET安全ASP.NET
- asp.net cookieASP.NETCookie
- ASP.NET 路由ASP.NET路由
- ASP.NET ISAPIASP.NETAPI
- ASP.Net 管道模型 VS Asp.Net Core 管道 總結ASP.NET模型