快速上手wap网站开发Word格式文档下载.docx
- 文档编号:22981358
- 上传时间:2023-02-06
- 格式:DOCX
- 页数:20
- 大小:193.07KB
快速上手wap网站开发Word格式文档下载.docx
《快速上手wap网站开发Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《快速上手wap网站开发Word格式文档下载.docx(20页珍藏版)》请在冰豆网上搜索。
login.aspx
前台代码具体如下:
1.<
%@
Page
Language="
C#"
AutoEventWireup="
true"
Inherits="
testWap.login"
Codebehind="
login.aspx.cs"
%>
2.<
Register
TagPrefix="
mobile"
Namespace="
System.Web.UI.MobileControls"
Assembly="
System.Web.Mobile"
3.
4.<
html
xmlns="
http:
//www.w3.org/1999/xhtml"
>
5.<
body>
6.
7.<
mobile:
Form
id="
Form1"
runat="
server"
<
!
--表单-->
8.
Label
ID="
z1"
Runat="
Font-Size="
Large"
ForeColor="
#3333cc"
登录窗口<
/mobile:
Label>
9.
--lbl_out:
信息标签,初始隐藏,登录失败后或退出系统时显示信息-->
10.
lbl_out"
Red"
Visible="
false"
11.
用户名:
br
/>
12.
TextBox
tb_User"
Size="
10"
TextBox>
--用户名输入框:
tb_User-->
13.
密码:
14.
tb_Pwd"
Password="
True"
--密码输入框:
tb_Pwd-->
15.
16.
Command
Button1"
OnClick="
Button1_OnClick"
登录<
Command>
--登录按钮-->
17.<
Form>
18.
19.<
/body>
20.<
/html>
21.
login.aspx.cs
后台代码具体如下:
1.using
System;
2.using
System.Collections;
3.using
System.ComponentModel;
4.using
System.Data;
5.using
System.Drawing;
6.using
System.Web;
7.using
System.Web.Mobile;
8.using
System.Web.SessionState;
9.using
System.Web.UI;
10.using
System.Web.UI.MobileControls;
11.using
System.Web.UI.WebControls;
12.using
System.Web.UI.HtmlControls;
13.using
System.Data.SqlClient;
14.
15.namespace
testWap
16.{
17.
public
partial
class
login
:
System.Web.UI.MobileControls.MobilePage
18.
{
19.
protected
void
Page_Load(object
sender,
EventArgs
e)
20.
{
21.
#region
系统退出时将信息标签lbl_out赋值并且显示
22.
if
(Session["
loginOutInfo"
]
=
null)
23.
24.
string
outInfo
Session["
].ToString();
25.
this.lbl_out.Text
outInfo;
26.
this.lbl_out.Visible
true;
27.
Session.Clear();
28.
}
29.
#endregion
30.
}
31.
32.
///
summary>
33.
登录验证
34.
/summary>
35.
param
name="
sender"
/param>
36.
e"
37.
Button1_OnClick(object
38.
39.
username
this.tb_User.Text.Trim();
40.
userpwd
this.tb_Pwd.Text.Trim();
41.
strCon
"
Data
Source=(local);
Database=wapDB;
Uid=sa;
Pwd=zxkj"
;
42.
strSql
select
*
from
userinfo
where
user_name='
+username+"
'
and
user_pwd='
+userpwd+"
43.
SqlConnection
conn
new
SqlConnection(strCon);
44.
conn.Open();
45.
SqlDataAdapter
da
SqlDataAdapter(strSql,
conn);
46.
DataSet
ds
DataSet();
47.
da.Fill(ds);
48.
conn.Close();
49.
50.
int
rowCount
ds.Tables[0].Rows.Count;
51.
52.
(rowCount
0)
53.
54.
username"
ds.Tables[0].Rows[0]["
user_name"
].ToString().Trim();
55.
Response.Redirect("
index.aspx"
);
56.
57.
else
58.
59.
用户名密码错误,请重新登录!
60.
61.
62.
63.
64.}
index.aspx
testWap.index"
index.aspx.cs"
8.<
lbl_uname"
9.<
wt"
文章列表<
10.<
ObjectList
ObjectList1"
--ObjectList控件-->
DeviceSpecific>
Choice>
ItemTemplate>
14.<
Link
Text='
%#
((ObjectListItem)Container)["
doc_title"
NavigateUrl='
view.aspx?
+((ObjectListItem)Container)["
doc_id"
]%>
Title"
NAME="
Wrapping="
Wrap"
15.<
Link>
/ItemTemplate>
/Choice>
/DeviceSpecific>
ObjectList>
21.<
lbl_page"
False"
1<
--页码:
lbl_page-->
22.<
lbl_pagecount"
--总页数:
lbl_pagecount-->
23.<
lnk_top"
BreakAfter="
首页
|
lnk_pre"
上一页<
24.<
lnk_end"
尾页
lnk_next"
下一页<
25.<
26.<
lbl_fabu"
发布文章:
27.<
lbl_error"
28.<
tb_title"
29.<
tb_content"
30.<
Button2"
Button2_OnClick"
发表<
退出<
31.<
32.
33.<
34.<
index.aspx.cs
index
==
登录时间到,请重新登录!
login.aspx"
this.lbl_uname.Text
欢迎您:
+(string)Session["
];
ok"
this.lbl_error.Text
发表成功!
this.lbl_error.Visible
31.
null;
(!
IsPostBack)
Bind();
38.
private
Bind()
rPage
Request.QueryString["
Page"
page
1;
(rPage
try
int.Parse(rPage);
49.
catch
51.
page"
page;
PagedDataSource
ps
PagedDataSource();
document
order
by
doc_id
desc"
64.
ps.DataSource
ds.Tables[0].DefaultView;
65.
ps.AllowPaging
66.
ps.PageSize
5;
67.
ps.CurrentPageIndex
-
68.
this.lnk_top.Visible
69.
this.lnk_pre.Visible
70.
this.lnk_next.Visible
71.
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 快速 上手 wap 网站 开发