ASP.NET+Ajax+Javascript实现页面定次刷新滚动内容
一、概述
Marquee:Html中滚屏控件,可以使包含在此标记中的内容进行各个方向,各种速度的滚动,因此在不考虑使用第三方控件的前提下,考虑使用Marquee+xmlhttp来实现定次更新页面中的滚动内容,此实现在IE6.0及以上版本测试通过,其他浏览器暂时未测试过。
Marquee中的onfinish事件:在给Marquee属性loop赋值后,完成这些次数时,会调用onfinish事件。
二、功能及特点
1、Javascript通过Microsoft的MSXML对象,动态获取后台数据库数据;
2、Javascript解析MSXML对象中的xml内容,整理为html后,显示给用户;
3、通过配置文件Config.xml中的参数,可以修改Marquee的滚动速度、每笔数据的滚动次数、延时、Marquee的高度、滚动方向、鼠标悬停是否定制滚动等。
三、前台Html
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FrmClearance.aspx.cs" Inherits="DynamicShow_FrmClearance" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>定次滚动示例</title>
<link href="../DynamicShow/Css/StyleSheet.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript" src="marquee.js"></script>
</head>
<body>
<form id="FrmClearance" runat="server">
<table id="BodyStyle" border="0px" width="100%">
<tr>
<td style="text-align: center; vertical-align: middle; font-family: 楷体_GB2312; font-size: 35px;
color: #0A246A; font-weight: bold; height: 160px">
&nbs
相关文档:
自定义控件中的页面代码:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="wcontrol.ascx.cs" Inherits="wcontrol" %>
<script type ="text/javascript">
function PopupCalendar(InstanceName)
{
///Global Tag
this.instanceName=InstanceName;
///Properties
this.separator="-"
t ......
用Javascript可以实现对GridView中某一行选择,而无需进行页面的刷新。
首先要在GridView的onrowdatabound的event handler中为GridView中的每一行onclick绑定event handler (Javascript)。假如GridView代码如下:
<asp:GridView runat="server" id="GridViewCategory" Aut ......
http://xiayuanfeng.javaeye.com/blog/(原文)
什么是函数(Function)
function sum(a,b){
return a+b;
}
其实通俗的说就是一个有名称的代码段,方便重用。
要注意的是:
1.Javascript 的函数语法,因为Javascript本身就是区分大小写的,所以function不能写作Function或 ......
以下以 IE 代替 Internet Explorer,以 MF 代替 Mozzila Firefox
1. document.form.item 问题
(1)现有问题:
现有代码中存在许多 document.formName.item("itemName") 这样的语句,不能在 MF 下运行
(2)解决方法:
&nb ......