⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s_personal.aspx

📁 ASP_NET程序设计教程 源代码 冶金工业出版社 肖金秀 冯沃辉 陈少涌
💻 ASPX
字号:
<% @ Import Namespace="Packaging" %>
<% @ Import Namespace="System.Data" %>
<% @ Register TagPrefix="pb" TagName="Header" Src="header.ascx" %>
<% @ Register TagPrefix="pb" TagName="Footer" Src="footer.ascx" %>
<% @ Register TagPrefix="pb" TagName="Login" Src="login.ascx" %>
<% @ Register TagPrefix="pb" TagName="Major" Src="major.ascx" %>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<title>Dot.Net论坛欢迎您!</title>
<script language="JavaScript">
<!--
function openwin(url,w,h) {
	window.open(url,"","top=50,left=150,height="+h+",width="+w+",toolbar=0,location=0,directories=0,menubar=0,scrollbars=0,resizable=yes,status=0");
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
<link rel="stylesheet" type="text/css" href="pack.css">
</head>

<body topmargin="6" leftmargin="0" bgcolor="#eaeaea">

<form runat="server" id="myform">

<pb:Header id="Header" runat="server" />

<div align="center">
<table border="0" cellpadding="0" cellspacing="1" bgColor="#006699" width="750" height="125">
	<tr><td width="25%" valign="top" background="images/bd.gif" rowspan="2" height="125">
	<pb:Login id="login" runat="server" />
	<pb:Major id="major" runat="server" /></td>
	<td width="75%" valign="top" bgcolor="#FFFFFF" height="228" background="images/ldb.gif">
		<br><asp:Label id="success" style="color:red" runat="server" />

	      <table border="0" cellpadding="0" cellspacing="1" width="95%" bgcolor="#006699">
            <tr><td colspan="4" width="100%">
		        <table cellpadding="0" cellspacing="1">
                  <tr>
                    <td width="70%" align="center" bgcolor="#99CC33">  
                      <table border="0" cellpadding="0" cellspacing="1" width="80%" bgcolor="#006699">
                        <tr><td width="100%" bgcolor="#FFFFFF">
<asp:TextBox id="Desc" runat="server"
	TextMode="Multiline"
	Cols="20" Rows="9" />
&nbsp;</td></tr>
			</table></td>
			        <td width="300" align="right" bgcolor="#99CC33"> <a href=# onClick="openwin('changeimage.aspx?id=<asp:literal id="sid" runat="server" />',400,250)">点这里更换你的照片</a><br>
                      <img id="photo" name="photo" border="0" align="right" runat="server" /></td>
                  </tr>
		</table>
		</td></tr>
		    <tr bgcolor="#ccff99"> 
              <td width="20%" align="center" height="25">姓名 <asp:RequiredFieldValidator
		ControlToValidate="Name"
		ErrorMessage="*"
		Display="Dynamic"
		runat=server/> </td>
		      <td width="30%" height="25"> <asp:TextBox id="Name" runat="server"
	size="20" maxlength="10" /> <asp:RequiredFieldValidator id="v1" runat=server
	controlToValidate="name" errorMessage="*" /> </td>
		      <td width="20%" align="center" height="25">年级</td>
		      <td width="30%" height="25"> <asp:TextBox id="Grade" runat="server"
	size="20" maxlength="4" /> </td>
            </tr>
		    <tr bgcolor="#ccff99"> 
              <td align="center" height="25">学号</td>
		      <td height="25"> <asp:TextBox id="Number" runat="server"
	size="20" maxlength="9" /> </td>
		      <td align="center" height="25">性别</td>
		      <td height="25"> <asp:RadioButtonList id="Gender" runat="server" RepeatDirection="Horizontal"> 
                <asp:ListItem value="男">男生</asp:ListItem> <asp:ListItem value="女">女生</asp:ListItem> 
                </asp:RadioButtonList> </td>
            </tr>
		    <tr bgcolor="#ccff99"> 
              <td align="center" height="25">寝室</td>
		      <td height="25"> <asp:TextBox id="Dorm" runat="server"
	size="20" maxlength="10" /> </td>
		      <td align="center" height="25">寝室电话</td>
		      <td height="25"> <asp:TextBox id="Tel" runat="server"
	size="20" maxlength="15" /> </td>
            </tr>
		    <tr bgcolor="#ccff99"> 
              <td align="center" height="25">其他电话</td>
		      <td height="25"> <asp:TextBox id="Tel2" runat="server"
	size="20" maxlength="15" /> </td>
		      <td align="center" height="25">BP</td>
		      <td height="25"> <asp:TextBox id="BP" runat="server"
	size="20" maxlength="20" /> </td>
            </tr>
		    <tr bgcolor="#ccff99"> 
              <td align="center" height="25">移动电话</td>
		      <td height="25"> <asp:TextBox id="Mobile" runat="server"
	size="20" maxlength="20" /> </td>
		      <td align="center" height="25">QQ</td>
		      <td height="25"> <asp:TextBox id="QQ" runat="server"
	size="20" maxlength="10" /> </td>
            </tr>
		    <tr bgcolor="#ccff99"> 
              <td align="center" height="25">信址</td>
		      <td colspan="3" height="25"> <asp:TextBox id="Address" runat="server"
	size="45" maxlength="100" /> </td>
            </tr>
		    <tr bgcolor="#ccff99"> 
              <td align="center" height="25">Email</td>
		      <td colspan="3" height="25"> <asp:TextBox id="Email" runat="server"
	size="45" maxlength="40" /> </td>
            </tr>
		    <tr bgcolor="#ccff99"> 
              <td align="center" height="25">MSN</td>
		      <td colspan="3" height="25"> <asp:TextBox id="MSN" runat="server"
	size="45" maxlength="40" /> </td>
            </tr>
		    <tr bgcolor="#ccff99"> 
              <td align="center" height="25">个人主页</td>
		      <td colspan="3" height="25"> <asp:TextBox id="Homepage" runat="server"
	size="45" maxlength="255" /> </td>
            </tr>
		    <tr bgcolor="#ccff99"> 
              <td align="center">爱好与特长</td>
		      <td colspan="3"><br>
<asp:TextBox id="Hobbies" runat="server"
	TextMode="Multiline"
	Cols="50" Rows="5" />
		&nbsp;</td></tr>
		    <tr bgcolor="#ccff99"> 
              <td align="center">对于未来的打算</td>
		      <td colspan="3"><br>
<asp:TextBox id="Future" runat="server"
	TextMode="Multiline"
	Cols="50" Rows="5" />
		&nbsp;</td></tr>
		    <tr bgcolor="#ccff99"> 
              <td align="center">&nbsp;</td>
		      <td colspan="3">&nbsp; <asp:Button id="change" runat="server" text="更改" onClick="change_Click" /> 
                <input type="reset" value="RESET">
		</td></tr>
	</table>
	</td>
	<tr><td width="75%" valign="bottom" bgcolor="#FFFFFF" height="80" align="right" background="images/ldb.gif">
	<img border="0" src="images/pen.gif" width="400" height="80"><br>&nbsp;</td></tr>
</table>
</div>

<pb:Footer id="footer" runat="server" />

</form>

</body>

</html>

<script language="VB" runat="server">

	Dim id As Integer

	Sub Page_Load(Sender As Object, e As EventArgs)
		If Not Request.IsAuthenticated Then
			Response.Redirect("login.aspx")
		End If
		Try
			id=CInt(Request("id"))
			Dim MyInfo As InfoDB=New InfoDB()
			If MyInfo.GetMyId(Context.User.Identity.Name)<>id And Context.User.Identity.Name<>"percyboy" Then
				Response.Redirect("access.aspx")
			End If
			If not Page.IsPostBack Then
				Bindform()
			End If
		Catch
			change.Visible=False
		End Try
	End Sub

	Sub Bindform()
		Dim MyInfo As InfoDB=New InfoDB()
		Dim DV As DataView=MyInfo.GetInfo1(id)
		Dim DR As DataRow=DV.Table.Rows(0)
		Try 
			Desc.Text=DR("Desc")
		Catch
		End Try
		Try
			photo.src=DR("photo")
		Catch
		End Try
		Try 
			Name.Text=DR("Name")
		Catch
		End Try
		Try 
			Grade.Text=DR("Grade")
		Catch
		End Try
		Try 
			Number.Text=DR("Number")
		Catch
		End Try
		If DR("Gender")="男" Then
			Gender.SelectedIndex=0
		Else
			Gender.SelectedIndex=1
		End If
		Try 
			Dorm.Text=DR("Dorm")
		Catch
		End Try
		Try 
			Tel.Text=DR("Tel")
		Catch
		End Try
		Try 
			Tel2.Text=DR("Tel2")
		Catch
		End Try
		Try 
			BP.Text=DR("BP")
		Catch
		End Try
		Try 
			Mobile.Text=DR("Mobile")
		Catch
		End Try
		Try 
			QQ.Text=DR("QQ")
		Catch
		End Try
		Try 
			Address.Text=DR("Address")
		Catch
		End Try
		Try 
			Email.Text=DR("Email")
		Catch
		End Try
		Try 
			MSN.Text=DR("MSN")
		Catch
		End Try
		Try 
			Homepage.Text=DR("Homepage")
		Catch
		End Try
		Try 
			Hobbies.Text=DR("Hobbies")
		Catch
		End Try
		Try 
			Future.Text=DR("Future")
		Catch
		End Try
		sid.Text=DR("Id")
	End Sub

	Sub change_Click(Sender As Object, e As EventArgs)
		Dim MyInfo As Info=New Info
		MyInfo.Id=Id
		MyInfo.Desc=Desc.Text
		MyInfo.Name=Name.Text
		MyInfo.Grade=Grade.Text
		MyInfo.Number=Number.Text
		MyInfo.Gender=Gender.SelectedItem.value
		MyInfo.Dorm=Dorm.Text
		MyInfo.Tel=Tel.Text
		MyInfo.Tel2=Tel2.Text
		MyInfo.BP=BP.Text
		MyInfo.Mobile=Mobile.Text
		MyInfo.QQ=QQ.Text
		MyInfo.Address=Address.Text
		MyInfo.Email=email.text
		MyInfo.MSN=MSN.Text
		MyInfo.Homepage=Homepage.Text
		MyInfo.Hobbies=Hobbies.Text
		MyInfo.Future=Future.Text
		Dim MyDB As InfoDB=New InfoDB()
		Try
			MyDB.ChangeInfo(MyInfo)
			success.text="修改成功!"
		Catch
			success.text="修改失败!"
		End Try
	End Sub
</script>
<style>
td {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size : 10pt;
}
.whiteB {
	color: white;
	font-weight : bold;
}
input {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size : 10pt;
}
td.bar {
	color: green; font-weight: bold;
}
a.whiteLink:link {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-weight : bold;
	color : white;
	text-decoration : none;
}
a.whiteLink:visited {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-weight : bold;
	color : white;
	text-decoration : none;
}
a.whiteLink:hover {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-weight : bold;
	color : white;
	text-decoration : none;
}
a.barLink:link {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	color : #CCFF99;
	text-decoration : none;
}
a.barLink:visited {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	color : #CCFF99;
	text-decoration : none;
}
a.barLink:hover {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	color : #CCFF99;
	text-decoration : underline;
}
a.author:link {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	color : black;
	text-decoration : none;
}
a.author:visited {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	color : black;
	text-decoration : none;
}
a.author:hover {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	color : black;
	text-decoration : underline;
}
</style>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -