asp.net ajax1.0基础回顾(七):综合应用
本文將通過學(xué)生信息管理來介紹asp.net ajax的綜合應(yīng)用實(shí)例,包括“瀏覽”、“查詢”、“添加”和“多選刪除”功能,以及其它相關(guān)設(shè)計(jì)。
本示例源代碼下載地址:http://down.51cto.com/data/220541
本示例中,程序架構(gòu)參考Petshop,前端基于jQuery基礎(chǔ)庫,數(shù)據(jù)庫采用SqlExpress,具體如下:
1.模塊設(shè)計(jì)
程序結(jié)構(gòu)參考PetShop,并根據(jù)實(shí)際情況進(jìn)行裁切,結(jié)構(gòu)圖如下:
其中,
Student:Web應(yīng)用程序,包括用戶界面;
Student.Object:類庫,包括業(yè)務(wù)對象;
Student.Entiy:類庫,包括業(yè)務(wù)實(shí)體;
GXSN.DAL.Util:類庫,包括通用數(shù)據(jù)訪問。
2.學(xué)生表
| ? | 字段名 | 類型(長度) | 可空 | 描述 |
| PK | SID | NVARCHAR2(48) | N | GUID編號 |
| UQ | NO | NVARCHAR2(32) | N | 學(xué)號 |
| ? | NAME | NVARCHAR2(128) | N | 姓名 |
| ? | AGE | INT | N | 年齡 |
| ? | SEX | NVARCHAR2(2) | N | 性別 |
| ? | CREATED | SMALLDATETIME | N | 注冊時(shí)間 |
?
3.vs解決方案
4.界面交互
i.列表瀏覽
ii.添加
iii.修改
5.程序設(shè)計(jì)
i.主頁前端
<head runat="server">
? ? <title>學(xué)生信息管理 - Asp.Net Ajax應(yīng)用示例</title>
? ? <link href="css/student.css" rel="stylesheet" type="text/css" />
? ? <script src="js/jquery-1.5.1.min.js" type="text/javascript"></script>
? ? <script src="js/student.js" type="text/javascript"></script>
</head>
<body>
? ? <form id="frmStudent" runat="server">
? ? <div>
? ? ? ? <asp:ScriptManager ID="smStudent" runat="server">
? ? ? ? <Scripts>
? ? ? ? ? ? <asp:ScriptReference Path="~/js/ajaxmanager.js" />
? ? ? ? </Scripts>
? ? ? ? </asp:ScriptManager>
? ? ? ? <h3>
? ? ? ? ? ? 學(xué)生信息管理 - Asp.Net Ajax應(yīng)用示例
? ? ? ? </h3>
? ? ? ? <asp:UpdateProgress ID="UpdateProgressStudent" runat="server"?
? ? ? ? ? ? AssociatedUpdatePanelID="upStudent" DisplayAfter="50">
? ? ? ? ? ? <ProgressTemplate>
? ? ? ? ? ? ? ? <div style="line-height:32px; vertical-align:middle;">
? ? ? ? ? ? ? ? ? ? <img alt="" src="img/loading.gif" style="width: 32px; height: 32px" />數(shù)據(jù)加載中...
? ? ? ? ? ? ? ? </div>
? ? ? ? ? ? </ProgressTemplate>
? ? ? ? </asp:UpdateProgress>
? ? ? ? <asp:UpdatePanel ID="upStudent" runat="server">
? ? ? ? ? ? <ContentTemplate>
? ? ? ? ? ? ? ? <asp:HiddenField ID="hfAction" runat="server" />
? ? ? ? ? ? ? ? <asp:HiddenField ID="hfResult" runat="server" />
? ? ? ? ? ? ? ? <asp:MultiView ID="mvStudent" runat="server" ActiveViewIndex="0">
? ? ? ? ? ? ? ? ? ? <asp:View ID="vwList" runat="server">
? ? ? ? ? ? ? ? ? ? ? ? <!--學(xué)生列表 GridView -->
? ? ? ? ? ? ? ? ? ? </asp:View>
? ? ? ? ? ? ? ? ? ? <asp:View ID="vwEdit" runat="server">
? ? ? ? ? ? ? ? ? ? ? ? <!--學(xué)生信息錄入,完成添加或修改 -->
? ? ? ? ? ? ? ? ? ? </asp:View>
? ? ? ? ? ? ? ? </asp:MultiView>
? ? ? ? ? ? </ContentTemplate>
? ? ? ? </asp:UpdatePanel>
? ? </div>
</form>
</body>
ii.Student業(yè)務(wù)單件類
iii.StudentInfo實(shí)體類
iv.SqlServer數(shù)據(jù)訪問輔助類
6.結(jié)語:程序設(shè)計(jì)簡單最好,僅供參考,相互交流。
轉(zhuǎn)載于:https://blog.51cto.com/pengjh/601997
總結(jié)
以上是生活随笔為你收集整理的asp.net ajax1.0基础回顾(七):综合应用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【转】如何用css限制文字长度,使溢出的
- 下一篇: oracle数据库plsqldev导出表