简单的asp.net模拟邮箱系统基础实现(二 (3)具体版块功能的实现及关键代码之母版页和写信界面)
2017-03-08 13:36
1221 查看
母版页
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="email.SiteMaster" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8"/>
<title></title>
<style type="text/css">
.auto-style1 {
font-size:20px;
padding-top:10px;
Height:30px;
Width:100px;
}
.auto_style4{
font-size:10px;
Height:30px;
Width:100px;
}
.auto-style2 {
height:
40px;
}
</style>
</head>
<body>
<form runat="server">
<div>
<div style="float:left">
<asp:image runat="server" ImageUrl="~/image/head.png"></asp:image></div>
<div style="float:left;padding-top:13px"> <asp:Label runat="server" Text="小飞邮箱" CssClass="auto-style1" ForeColor="#0066FF"></asp:Label><br />
<asp:Label runat="server" Text="mail.xf.com" CssClass="auto-style4" ForeColor="#0066FF"></asp:Label></div>
<div style="float:left"><asp:Image runat="server" ID="userPhoto" Height="48px" Width="40px" ImageUrl="~/image/back.jpg"/></div>
<div style="float:left;padding-top:15px"> <asp:Label runat="server" id="userid" Text="a1006817478(楚门)" Font-Size="15px"></asp:Label><br/>
<asp:LinkButton runat="server" Text="个人中心" PostBackUrl="~/inforPage.aspx" Font-Size="13px"></asp:LinkButton>
</div>
<div style="float:right;padding-top:15px"> <asp:LinkButton runat="server" Text="关于" Font-Size="13px"></asp:LinkButton> |
<asp:LinkButton runat="server" Text="退出" Font-Size="13px" PostBackUrl="~/LoginPage.aspx"></asp:LinkButton>
</div>
</div>
<div style="float:left">
<table width="960" border="0" style="padding-left:0px">
<tr>
<th width="160" height="600" align="center" valign="top" bgcolor="#6699FF" scope="col" style="background-color:
#c5d8ff"><table width="150" height="280" border="0">
<tr>
<th width="150" style="text-align:
left; height: 40px;" scope="col">
<asp:LinkButton ID="LinkButton1" runat="server" Style="color:
blue" PostBackUrl="~/SendPage.aspx" CausesValidation="False">写信</asp:LinkButton> </th>
</tr>
<tr>
<th width="150" height="40" style="text-align:
left" scope="row">
<asp:LinkButton ID="LinkButton2" runat="server" style="color:
blue" PostBackUrl="~/RecfPage.aspx" CausesValidation="False">收件箱</asp:LinkButton></th>
</tr>
<tr>
<th width="150" height="40" style="text-align:
left" scope="row">
<asp:LinkButton ID="LinkButton7" runat="server" style="color:
blue" PostBackUrl="~/ContactPage.aspx" CausesValidation="False">通信录</asp:LinkButton></th>
</tr>
<tr>
<th width="150" height="40" style="text-align:
left" scope="row">
<asp:LinkButton ID="LinkButton3" runat="server" style="color:
blue" CausesValidation="False">发件箱</asp:LinkButton></th>
</tr>
<tr>
<th width="150" style="text-align:
left" scope="row" class="auto-style2">
<asp:LinkButton ID="LinkButton4" runat="server" style="color:
blue" CausesValidation="False">草稿箱</asp:LinkButton></th>
</tr>
<tr>
<th width="150" height="40" style="text-align:
left" scope="row">
<asp:LinkButton ID="LinkButton5" runat="server" style="color:
blue" CausesValidation="False">重要邮件</asp:LinkButton></th>
</tr>
<tr>
<th width="150" style="text-align:
left; height: 40px;" scope="row">
<asp:LinkButton ID="LinkButton6" runat="server" style="color:
blue" CausesValidation="False">垃圾箱</asp:LinkButton></th>
</tr>
</table></th>
<th align="left" valign="top" scope="col">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</th>
</tr>
</table>
</div>
</form>
</body>
</html>
C#
namespace email
{
public partial class SiteMaster :
MasterPage
{
protected void Page_Load(object sender,
EventArgs e)
{
if (!IsPostBack)
{
String str =
@"Data Source = (LocalDB)\MSSQLLocalDB; AttachDbFilename = C:\Users\asus\Documents\Visual Studio 2015\Projects\email\email\App_Data\DB.mdf; Integrated Security = True";
SqlConnection con =
new SqlConnection(str);
SqlCommand cmd =
new SqlCommand("select * from userInfor where USERID=" +
"'" + Session["userid"] +
"'", con);
SqlDataReader myReader =
null;
try
{
con.Open();
myReader = cmd.ExecuteReader();
while (myReader.Read())
{
userid.Text = Session["userid"] +
"<" + myReader[1] +
">";
if (myReader[6] !=
null)
{
userPhoto.ImageUrl =
"~/UserPhotos/" + myReader[6];
}
}
}
catch
{
}
finally
{
if (myReader !=
null)
{
myReader.Close();
}
con.Close();
}
}
}
}
}
相关文章推荐
- 简单的asp.net模拟邮箱系统基础实现(二 (4)具体版块功能的实现及关键代码之收件和写信)
- 简单的asp.net模拟邮箱系统基础实现(二 (1)具体版块功能的实现及关键代码之注册页面)
- 简单的asp.net模拟邮箱系统基础实现(二 (2)具体版块功能的实现及关键代码之登陆页面)
- 简单的asp.net模拟邮箱系统基础实现(一 总体功能版块的设计,与简单数据库的设计)
- sql server 关于表中只增标识问题 C# 实现自动化打开和关闭可执行文件(或 关闭停止与系统交互的可执行文件) ajaxfileupload插件上传图片功能,用MVC和aspx做后台各写了一个案例 将小写阿拉伯数字转换成大写的汉字, C# WinForm 中英文实现, 国际化实现的简单方法 ASP.NET Core 2 学习笔记(六)ASP.NET Core 2 学习笔记(三)
- ASP.NET MVC4 WEB API入门 第二篇:ASP.NET MVC入门基础(2)—— 简单登录功能的实现
- [导入]Asp.net 2.0 自定义控件开发[实现自动计算功能(AutoComputeControl)][示例代码下载]
- 文件的下载(ASP.NET实现邮箱中附件下载的功能)
- AjaxPro.NET实现TextBox智能获取服务端数据功能(Asp.net 2.0)(示例代码下载)
- Asp.net 2.0 C#实现压缩/解压功能 (示例代码下载)
- asp.net简单新闻系统之基础数据操作类
- Asp.net 2.0 自定义控件开发[实现自动计算功能(AutoComputeControl)][示例代码下载续][重点推荐控件]
- Asp.net 2.0 自定义控件开发[实现自动计算功能(AutoComputeControl)][示例代码下载][续]
- 要用ASP.NET实现邮箱中附件下载的功能
- 转载:Asp.net 2.0 C#实现压缩/解压功能 (示例代码下载)
- Asp.net 2.0 自定义控件开发[实现自动计算功能(AutoComputeControl)][示例代码下载]
- 一个简单的AJAX实现,基于C#的ASP.Net,包括服务器端的程序代码
- 一个简单的AJAX实现,基于C#的ASP.Net,包括服务器端的程序代码
- Asp.net 2.0 C#实现压缩/解压功能 (示例代码下载)
- 要用ASP.NET实现邮箱中附件下载的功能