易截截图软件、单文件、免安装、纯绿色、仅160KB

Javascript实现GridView无刷新选择一行

用Javascript可以实现对GridView中某一行选择,而无需进行页面的刷新。
首先要在GridView的onrowdatabound的event handler中为GridView中的每一行onclick绑定event handler (Javascript)。假如GridView代码如下:
        <asp:GridView runat="server" id="GridViewCategory" AutoGenerateColumns="False"
    Width="100%" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid"
    BorderWidth="3px" CellPadding="4" CellSpacing="2"
ForeColor="Black" onrowdatabound="GridViewCategory_RowDataBound">
        <RowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="Description" HeaderText="Category" />
        </Columns>
        <FooterStyle BackColor="#CCCCCC" />
        <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />                       
        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
</asp:GridView>
onrowdatabound的event handler代码如下:
        protected void GridViewCategory_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
 &nbs


相关文档:

JavaScript 获取对象的高度和宽度详细说明

scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetL ......

设为首页和添加收藏的Javascript代码

设为首页和添加收藏的Javascript代码,兼容性还可以,各种主流浏览器都测试通过了。
function addfavorite(){//加入收藏
if (document.all){
window.external.addFavorite("http://"+document.location.host+"/",document.title);
}else if (window.sidebar){
window.sidebar.addPanel(document.tit ......

javascript运行、调试工具

      最近在学习javascript,对于如何运行调试却不了解。以为在记事本中编辑好文件后保存为htm文件,然后在浏览器中打开就可以了,但我试了多次都不成功,后来终于发现原来我在记事本中编辑保存的文件的后缀名为“.txt”。
     解决方法:“文件夹选项&rdqu ......

关于javascript内存泄露

<html>
<body>
<script type="text/JScript">
for (i=0; i<10000; i++) {    // this loop enforces the effect
    var model = new Object();
    var element = document.createElement("<br>");
    model.myElement = ......

Asp.net中自定义控件引用javascript中的日历脚本心得


自定义控件中的页面代码:
<%@ 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 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号