温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:Asp.net2.0的电影在线点播系统片段源码
当前文件:
MovieShowSample/Register.aspx,打开代码结构图
MovieShowSample/Register.aspx,打开代码结构图1<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Register.aspx.cs" Inherits="Register" %> 2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4
5
<html xmlns="http://www.w3.org/1999/xhtml" > 6
<head runat="server"> 7
<link rel="shortcut icon" href="/MovieShow/Images/Real-doc.ico" type="image/x-icon" /> 8
<title>MovieShow--用户注册</title> 9
<script language="javascript" type="text/javascript"> 10
function callserver1(control) 11
{ 12
if(document.getElementById("<%=txtname.ClientID %>").value=="") 13
alert("请输入用户名...!"); 14
else 15
{ 16
//构造将要传递给GegCallbackEventReferance的参数 17
var context=document.getElementById("<%=test.ClientID %>"); 18
var arg="CheckName|"+control.value; 19
//显示提示信息 20
context.innerHTML= "<IMG SRC='/MovieShow/Images/pie.gif' />Loading..."; 21
//调用服务器端函数 22
<%= ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData1", "context")%>; 23
24
} 25
26
} 27
28
function ReceiveServerData1(result, context) 29
{ 30
context.innerHTML =result; 31
} 32
33
function callserver2() 34
{ 35
if(document.getElementById("<%=txtname.ClientID %>").value=="") 36
alert("请先检验用户名...!"); 37
else if(document.getElementById("<%=txtpwd.ClientID %>").value=="") 38
alert("请输入密码...!"); 39
else if((document.getElementById("<%=txtpwd.ClientID %>").value)!=(document.getElementById("<%=txtpwdr.ClientID %>").value)) 40
alert("两次密码输入不一样...!"); 41
else 42
{ 43
//构造将要传递给GegCallbackEventReferance的参数 44
var name=document.getElementById("txtname").value; 45
var pwd=document.getElementById("txtpwd").value; 46
var sex=document.getElementById("txtsex").value; 47
var xz=document.getElementById("txtxz").value; 48
var email=document.getElementById("txtemail").value; 49
var phone=document.getElementById("txtphone").value; 50
var qq=document.getElementById("txtqq").value; 51
var arg="register|"+name+"|"+pwd+"|"+email+"|"+xz+"|"+sex+"|"+phone+"|"+qq; 52
53
var context=document.getElementById("subtest"); 54
context.innerHTML="<IMG SRC='/MovieShow/Images/pie.gif' />Loading..."; 55
//调用服务器端函数 56
<%= ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData2", "context")%>; 57
58
} 59
} 60
function ReceiveServerData2(result, context) 61
{ 62
context.innerHTML=result; 63
if(result=="OK,注册成功!") 64
{ 65
66
window.location.reload("Default.aspx"); 67
} 68
69
} 70
71
</script> 72
73
74
</head> 75
<body> 76
<form id="form1" runat="server"> 77
<div style=" width:820px; height:150px;left: 108px; top: 4px; z-index: 101; position: absolute;" > 78
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="820" height="150"> 79
<param name="movie" value="/MovieShow/Navigation/Head.swf" /> 80
<param name="quality" value="high" /> 81
<param name="wmode" value="transparent" /> 82
<embed src="/MovieShow/Navigation/Head.swf" width="820" height="150" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed> 83
</object> 84
</div> 85
<div> 86
<div style=" z-index: 100; background-image:url(/MovieShow/Images/Register.jpg); left: 0px; width: 1000px; position: absolute; top: 160px; 87
height: 454px"> 88
<input id="Text1" readonly="readonly" style="z-index: 117; left: 312px; width: 44px; 89
border-top-style: none; border-right-style: none; border-left-style: none; position: absolute; 90
top: 64px; height: 12px; border-bottom-style: none" type="text" value="用户名:" unselectable="on" /> 91
<input id="Text2" readonly="readonly" style="z-index: 118; left: 312px; width: 44px; 92
position: absolute; top: 88px; height: 12px" type="text" value="用密码:" unselectable="on" /> 93
<input id="Text3" readonly="readonly" style="z-index: 119; left: 300px; width: 56px; 94
position: absolute; top: 112px; height: 12px" type="text" value="重复密码:" unselectable="on" /> 95
<input id="Text4" readonly="readonly" style="z-index: 120; left: 324px; width: 32px; 96
position: absolute; top: 136px; height: 12px" type="text" value="性别:" unselectable="on" /> 97
<input id="Text5" readonly="readonly" style="z-index: 121; left: 284px; width: 72px; 98
position: absolute; top: 160px; height: 12px" type="text" value="Email:" unselectable="on" /> 99
<input id="Text6" readonly="readonly" style="z-index: 122; left: 324px; width: 32px; 100
position: absolute; top: 184px; height: 12px" type="text" value="星座:" unselectable="on" /> 101
<input id="Text7" readonly="readonly" style="z-index: 123; left: 324px; width: 32px; 102
position: absolute; top: 208px; height: 12px" type="text" value="电话:" unselectable="on" /> 103
<input id="Text8" readonly="readonly" style="z-index: 124; left: 324px; width: 32px; 104
position: absolute; top: 232px; height: 12px" type="text" value="QQ:" unselectable="on" /> 105
<br /> 106
<asp:Label ID="Label1" runat="server" ForeColor="Red" Style="z-index: 100; left: 304px; 107
position: absolute; top: 64px" Text="*" Width="1px"></asp:Label> 108
<asp:Label ID="Label2" runat="server" ForeColor="Red" Style="z-index: 101; left: 300px; 109
position: absolute; top: 92px" Text="*" Width="1px"></asp:Label> 110
<asp:Label ID="Label3" runat="server" ForeColor="Red" Style="z-index: 102; left: 288px; 111
position: absolute; top: 112px" Text="*" Width="1px"></asp:Label> 112
<asp:TextBox ID="txtname" runat="server" Height="12px" Style="z-index: 103; left: 368px; 113
position: absolute; top: 64px" Width="120px"></asp:TextBox> 114
<asp:TextBox ID="txtpwd" runat="server" Height="12px" Style="z-index: 104; left: 368px; 115
position: absolute; top: 88px" TextMode="Password" Width="120px"></asp:TextBox> 116
<asp:DropDownList ID="txtsex" runat="server" EnableViewState="False" Style="z-index: 105; 117
left: 372px; position: absolute; top: 132px"> 118
<asp:ListItem>男</asp:ListItem> 119
<asp:ListItem>女</asp:ListItem> 120
</asp:DropDownList> 121
<asp:DropDownList ID="txtxz" runat="server" EnableViewState="False" Style="z-index: 106; 122
left: 372px; position: absolute; top: 184px"> 123
<asp:ListItem>水瓶</asp:ListItem> 124
<asp:ListItem>双鱼</asp:ListItem> 125
<asp:ListItem>白羊</asp:ListItem> 126
<asp:ListItem>金牛</asp:ListItem> 127
<asp:ListItem>双子</asp:ListItem> 128
<asp:ListItem>巨蟹</asp:ListItem> 129
<asp:ListItem>狮子</asp:ListItem> 130
<asp:ListItem>处女</asp:ListItem> 131
<asp:ListItem>天秤</asp:ListItem> 132
<asp:ListItem>天蝎</asp:ListItem> 133
<asp:ListItem>射手</asp:ListItem> 134
<asp:ListItem>魔羯</asp:ListItem> 135
</asp:DropDownList> 136
<asp:ImageButton ID="submit" runat="server" BorderStyle="Outset" ImageUrl="~/Images/submit.jpg" 137
Style="z-index: 107; left: 380px; position: absolute; top: 328px" ToolTip="提交" /> 138
<asp:Label ID="test" Text="" runat="server" Style="z-index: 108; left: 500px; position: absolute; 139
top: 64px" Font-Bold="False" Font-Size="Smaller"></asp:Label> 140
<asp:Label ID="subtest" runat="server" Font-Bold="False" Font-Size="Smaller" Style="left: 372px; 141
position: relative; top: 276px; z-index: 109;"></asp:Label> 142
<br /> 143
<asp:ImageButton ID="check" runat="server" BorderStyle="Outset" ImageUrl="~/Images/find.jpg" 144
Style="z-index: 110; left: 444px; position: absolute; top: 328px" ToolTip="检查用户名" /> 145
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtemail" 146
ErrorMessage="注意Eamil的格式" Font-Size="Small" Style="z-index: 111; left: 500px; 147
position: absolute; top: 160px" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator> 148
<br /> 149
<br /> 150
<asp:TextBox ID="txtpwdr" runat="server" Height="12px" 151
Style="z-index: 112; left: 368px; position: absolute; top: 112px" TextMode="Password" 152
Width="120px"></asp:TextBox> 153
<asp:TextBox ID="txtemail" runat="server" Height="12px" Style="z-index: 113; left: 368px; 154
position: absolute; top: 160px" Width="120px"></asp:TextBox> 155
<asp:TextBox ID="txtphone" runat="server" Height="12px" Style="z-index: 114; left: 368px; 156
position: absolute; top: 208px" Width="120px"></asp:TextBox> 157
<asp:TextBox ID="txtqq" runat="server" Height="12px" Style="z-index: 115; left: 368px; 158
position: absolute; top: 232px" Width="120px"></asp:TextBox> 159
<div style=" background-image:url(/MovieShow/Images/foot1.jpg);z-index: 125; left: -14px; width: 244px; position: absolute; top: 408px; 160
height: 48px"> 161
</div> 162
</div> 163
164
</div> 165
</form> 166
</body> 167
</html> 168






}
