前端:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="滑动门.aspx.cs" Inherits="UI.滑动门" %>

<!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>
  <link rel="stylesheet" href="css/style.css" />
</head>
<body>
<form id="form1" runat="server">
<div class="solidBox">
<h3 class="solidBox_title">
<asp:ListView ID="ListTitle" runat="server">
<ItemTemplate>
<!--自定义模板-->
<strong runat="server" id="Title" class="">
<%#Eval("Title") %>
</strong>
</ItemTemplate>
</asp:ListView>
</h3>
<div class="solidBox_content">
<asp:ListView ID="ListContent" runat="server">
<ItemTemplate>
<!--自定义模板-->
<strong runat="server" id="Content">
<%#Eval("Content") %>
</strong>
</ItemTemplate>
</asp:ListView>
</div>
</div>
</form>
</body>
</html>

样式重置:

/*
* 样式重置文件
*/
body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
form,
fieldset,
input,
textarea,
p,
blockquote,
th,
td {
margin:;
padding:;
font-weight: normal;
font-style: normal;
font-size: 12px;
font-family: inherit;
}
table {
border-collapse: collapse;
border-spacing:;
}
fieldset,
img {
border:;
}
address,
caption,
cite,
code,
dfn,
em,
strong,
th,
var {
font-style: normal;
font-weight: normal;
}
ol,
ul {
list-style: none;
}
caption,
th {
text-align: left;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: 100%;
font-weight: normal;
}
q:before,
q:after {
content: '';
}
abbr,
acronym {
border:;
}
a {
color: #333;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/*通用父子盒子嵌套浮动问题解决,开始*/ .clearfix:after {
content: ".";
display: block;
height:;
clear: both;
visibility: hidden;
}
.clearfix {
display: inline-block;
}
* html .clearfix {
height: 1%;
}
.clearfix {
display: block;
}
/*通用父子盒子嵌套浮动问题解决,结束*/
/*间隙层开始*/ .space_hx {
/*横向间隙*/ clear: both;
width: 100%;
height: 10px;
font-size: 1px;
overflow: hidden;
}
.space_zx {
/*纵向间隙*/ float: left;
width: 10px;
font-size: 1px;
overflow: hidden;
}
/*间隙层结束*/

样式:

        .solidBox {
width: 330px;
height: 187px;
margin: 20px;
border-left: #CCCCCC 1px solid;
overflow: hidden;
}
/*.solidBox .solidBox_title 中间空格是父子关系,以逗号隔开是同级关系*/ .solidBox .solidBox_title {
height: 30px;
line-height: 30px;
} .solidBox .solidBox_title div {
float: left;
/*变成块级元素*/
width: 109px;
height: 30px;
border: #CCCCCC 1px solid;
text-align: center;
border-left: none;
font: 16px "微软雅黑";
cursor: pointer;
/*cursor局部鼠标的样式*/
} .solidBox .solidBox_title .hover {
background: #9D9D9D;
color: #FFF;
} .solidBox .solidBox_content {
padding: 5px;
border: #CCCCCC 1px solid;
border-left: none;
border-top: none;
height: 157px;
width: 327px;
overflow: hidden;
}

后台:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient; namespace UI
{
public partial class 滑动门 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DBind();
}
private void DBind()
{
SqlConnection conn = new SqlConnection("Server=.;database=Test;uid=sa;pwd=x");
conn.Open();
SqlCommand cmd = new SqlCommand("select * from huadongmen",conn);
SqlDataReader reader = cmd.ExecuteReader();
List<huadongmen> list = new List<huadongmen>();
while (reader.Read())
{
huadongmen sb = new huadongmen();
sb.Title = reader[].ToString();
sb.Content = reader[].ToString();
list.Add(sb);
}
reader.Close();
conn.Close();
ListTitle.DataSource = list;
ListTitle.DataBind();
ListContent.DataSource = list;
ListContent.DataBind();
}
}
}
 

附上数据库脚本:

create database Test
go
use Test
create table huadongmen
(
title varchar(20),
content varchar(500)
)
go
insert into huadongmen values('标题一','这是标题一的内容')
insert into huadongmen values('标题二','这是标题二的内容')
insert into huadongmen values('标题三','这是标题三的内容') update huadongmen set content='这是标题二的内容' where title='标题二'
select * from huadongmen

asp.net实现数据库版动态网页滑动门的更多相关文章

  1. HTML+CSS技术实现网页滑动门效果

    一.什么是滑动门 大家在网页中经常会见到这样一种导航效果,因为使用频率广泛,所以广大的程序员给它起了一个名字,叫做滑动门.在学习滑动门之前,首先你要了解什么是滑动门. 小米官网,网页滑动门效果 二.实 ...

  2. Javascript学习笔记2.2 Javascript与DOM选项卡(滑动门)案例详解

    学习了DOM的知识,今天开始做些练习,想到了一个网页滑动门的特效,见下图: 1.通过建立索引实现 <!doctype html> <html> <head> < ...

  3. 转!!常用的4种动态网页技术—CGI、ASP、JSP、PHP

    1.CGI   CGI(Common Gateway Interface,公用网关接口)是较早用来建立动态网页的技术.当客户端向Web服务器上指定的CGI程序发出请求时,Web服务器会启动一个新的进程 ...

  4. python网络爬虫抓取动态网页并将数据存入数据库MySQL

    简述以下的代码是使用python实现的网络爬虫,抓取动态网页 http://hb.qq.com/baoliao/ .此网页中的最新.精华下面的内容是由JavaScript动态生成的.审查网页元素与网页 ...

  5. 静态网页VS动态网页

    干<沙朗新闻发布系统>什么时候.我们已经建立的网页.html的,并且.aspx,第一次接触.我认为这些东西是一样的,因为它,在观看ASP.NET视频的时候.听见里面讲课的老师有提到了这两样 ...

  6. JSP动态网页

    01.什么是服务器 02.什么是动态网页  动态网页是指在服务器端运行的,使用程序语言设计的交互式网页,它们会根据某种条件的变化,返回不同的网页内容.可以让用户和服务器交互的网站 动态网站可以实现交互 ...

  7. 【Asp.net入门01】动态网站基础知识

    本节将介绍: 网站搭建流程 动态网站相关基础概念 网页的访问原理 使用浏览器访问网站是我们几乎天天在做的事情.以前我们只需要关注网页内容,作为网站开发人员,从现在开始我们要关注更深层次的东西了. 1. ...

  8. JSP/Servlet开发——第一章 动态网页基础

    1.动态网页:在服务端运行的使用程序语言设计的交互网页 : ●动态网站并不是指具有动画功能的网站,而是指网站内容可根据不同情况动态变更的网站(股票网站),一般情况下动态网站通过数据库进行架构. ●动态 ...

  9. JSP技术基础(动态网页基础)

    前言:如果说html为静态网页基础,那么jsp就是动态网页基础,两者的区别就是jsp在html的前面多加了几行而已.当然,jsp里面对java的支持度更高.要明白,js只是嵌入在客户端的小程序小脚本而 ...

随机推荐

  1. zabbix安装配置界面点击next step没反应

    修改/var/lib/php/session/宿主或者添加777权限 看到有个人说这个不能用,一开始我也没用,找了各种方式都不行,最后死马当作活马医,改了下权限,卧槽,一下子就OK了,日

  2. 考前预习(Ubuntu配备)

    这几天考前预习,趁现在不想预习,写点之前就想写的东西吧. 贴一下个人认为有用的,在Ubuntu装机后的一些小事.不过挺杂的,主要是拿来给以后的自己看,以及让现在无聊的我有点事做. 首先,Ubuntu官 ...

  3. Java算法之递归打破及在真实项目中的使用实例

    开心一笑 刚才领导问开发:"你觉得这个项目的最大风险是什么",开发说:"加班猝死" , 气氛尴尬了一分钟!!! 提出问题 1.递归算法简单复习 2.如何实现递归 ...

  4. git整理

    git图形客户端:SourceTree bash: 先初始化: git init 添加远程仓库: git remote add sae https://git.sinacloud.com/newapp

  5. cornerstone知识点

    CornerStone使用教程(配置SVN,HTTP及svn简单使用) 发布时间:2015-01-02 19:54   作者:芳仔小脚印    来源:开源中国 CornerStone是Mac OS X ...

  6. Photoshop 裁剪图片

    如图1选择裁剪工具,然后如图2点一下clear,就可以根据鼠标裁剪任意大小的图片

  7. oh my zsh

    简单使用oh my zsh 安装oh my Zsh 安装zsh 安装curl或者wget 下载并安装oh my zsh: curl 下载方式curl -L https://raw.github.com ...

  8. LINQ

    lambda表达式: LINQ to Object: 参考:http://www.cnblogs.com/leon-y-liu/articles/3575009.html LINQ to XML: u ...

  9. 用goto做异常处理

    http://www.cnblogs.com/trying/archive/2012/06/25/2863753.html 今天在CSDN上看到的关于错误返回值的讨论,感觉非常有趣. 从中可以看出被教 ...

  10. NetMQ(二): 请求响应模式 Request-Reply

    ZeroMQ系列 之NetMQ 一:zeromq简介 二:NetMQ 请求响应模式 Request-Reply 三:NetMQ 发布订阅模式 Publisher-Subscriber 四:NetMQ ...