博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
asp.net实现数据库版动态网页滑动门
阅读量:6998 次
发布时间:2019-06-27

本文共 4615 字,大约阅读时间需要 15 分钟。

前端:

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

<%#Eval("Title") %>

<%#Eval("Content") %>

样式重置:

/* * 样式重置文件 */body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
margin: 0; padding: 0; font-weight: normal; font-style: normal; font-size: 12px; font-family: inherit;}table {
border-collapse: collapse; border-spacing: 0;}fieldset,img {
border: 0;}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: 0;}a {
color: #333; text-decoration: none;}a:hover {
text-decoration: underline;}/*通用父子盒子嵌套浮动问题解决,开始*/.clearfix:after {
content: "."; display: block; height: 0; 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
list = new List
(); while (reader.Read()) { huadongmen sb = new huadongmen(); sb.Title = reader[0].ToString(); sb.Content = reader[1].ToString(); list.Add(sb); } reader.Close(); conn.Close(); ListTitle.DataSource = list; ListTitle.DataBind(); ListContent.DataSource = list; ListContent.DataBind(); } }}
 

附上数据库脚本:

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

 

转载于:https://www.cnblogs.com/zhankui/p/4542486.html

你可能感兴趣的文章
linux守护进程解读
查看>>
Windows操作系统单文件夹下到底能存放多少文件及单文件的最大容量
查看>>
POJ2079:Triangle——题解
查看>>
关于UITableView 不能回调 tableView: cellForRowAtIndexPath的问题
查看>>
linux 批量创建用户获取8位随机密码
查看>>
WPF 单实例应用程序
查看>>
解决wordpress无法发送邮件的问题|配置好WP-Mail-SMTP的前提
查看>>
debian包之间的关系
查看>>
php生成随机数mt_rand和rand
查看>>
04.Linux Disk Partition & Mount Point
查看>>
ios系统的特点
查看>>
mac下配置java运行环境
查看>>
gsoap、c++。webservice的client。
查看>>
java中sleep()和wait()的区别
查看>>
[JAVA]UUID
查看>>
Win10优化
查看>>
【洛谷P1352】没有上司的舞会
查看>>
js中数组的合并和对象的合并
查看>>
解决 UE4 无法找到。generated.h 办法
查看>>
python 读取SQLServer数据插入到MongoDB数据库中
查看>>