前端:

<%@ 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. .net测试学习--理解.net测试选项

    1.创建基于测试简单应用程序 (1)启动visual studio(有安装c#的) (2)  选择File|New project (3)创建一个C# project,名字和保存路径自己设定,假设取名 ...

  2. CGAffineTransform

    这个是CoreGraphics框架中的CGAffineTransform类,可用于设定UIView的transform属性.控制视图的缩放.旋转和平移操作.另称仿射变换矩阵. Quartz转换实现原理 ...

  3. 【webGL】threejs入门 ---创建一个简单立方体

    开发环境 Three.js是一个JavaScript库,所以,你可以使用平时开发JavaScript应用的环境开发Three.js应用.如果你没什么偏好的话,我会推荐Komodo IDE. 调试建议使 ...

  4. 悬浮TabBar的实现--此段代码来自网络

    悬浮TabBar的实现 这个TabBar看着像是用自定义TabBar做的,但事实上它还是用的系统的TabBar,给系统的tabBar.backgroundImage设置一张设计好的背景图片. TabB ...

  5. Top 命令详解

    Top 命令详解 先感受一下top命令的执行结果吧!哈哈-- top - 17:32:34 up 3 days, 8:04, 5 users, load average: 0.09, 0.12, 0. ...

  6. October 30th Week 45th Sunday 2016

    Genius is nothing but labor and diligence. 天才不过是勤奋而已. Labor and diligence are the requirements for s ...

  7. JavaScript 操作 Cookie

    转自作者:聂微东出处:http://www.cnblogs.com/Darren_code/      什么是 Cookie “cookie 是存储于访问者的计算机中的变量.每当同一台计算机通过浏览器 ...

  8. javascript 框架、根基技巧、布局、CSS、控件 JavaScript 类库

    预筹备之 JavaScript 今朝支流的 JavaScript 框架排名中,jQuery 和 Ext 可算是佼佼者,得到了用户的普遍好评.海内的一些框架许多也是模仿 jQuery 对 JavaScr ...

  9. android include进来的组件 调用其子元素

    include标签包裹着一个可复用的布局: <include layout="@layout/footer_detail" android:id="@+id/foo ...

  10. C++ 系列:多线程编程基础知识

    Copyright © 1900-2016, NORYES, All Rights Reserved. http://www.cnblogs.com/noryes/ 欢迎转载,请保留此版权声明. -- ...