06 Apr 2004

弹出窗口刷新它的父页面后。出现不重新发送信息,则无法刷新网页

做的东西弹出一个窗口处理某些动作后刷新父窗口

window.opener.location.reload();
刷新
如果父窗口在此之前如果有过提交数据的动作,则会出现这么个讨厌的对话筐
“不重新发送信息,则无法刷新网页”
痛苦......
CSDN搜索未果(有几贴都是用Response.Redirect的方法,但我这里是刷父窗口)。
痛苦.
........
翻我的小本本 后找到办法

window.opener.location.href=window.opener.location.href
去刷新(其实是重定位了一下)父窗口
可行。
总结: 不能一棵树上掉死 :P

05 Apr 2004

DataGrid点击删除按钮弹出确认对话框一个好办法

原文地址
http://expert.csdn.net/Expert/topic/2852/2852126.xml?temp=.4770471 
其中
wf5360308(峰)
提供的方法
datagrid-》属性生成器-》列-》添加按钮列-》删除-》文本(T)->在文本框里加上:
<div id="de" onclick="JavaScript:return confirm('确定删除吗?')">删除</div>

不错的办法哦~

05 Apr 2004

DataGrid点击删除按钮弹出确认对话框一个好办法

原文地址
http://expert.csdn.net/Expert/topic/2852/2852126.xml?temp=.4770471 
其中
wf5360308(峰)
提供的方法
datagrid-》属性生成器-》列-》添加按钮列-》删除-》文本(T)->在文本框里加上:
<div id="de" onclick="JavaScript:return confirm('确定删除吗?')">删除</div>

不错的办法哦~

05 Apr 2004

如何在ItemDataBound内获得DataGrid的列名称HeaderText

如果 AutoGenerateColumns=“false” 使用绑定列,模板列 则比较好办,直接使用 YourDataGrid.Columns[编号].HeaderText 获得 可是,如果 AutoGenerateColumns=“true” ,就比较麻烦了,因为这时YourDataGrid.Columns.Count是0 但是可以变通做到。

<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<!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" xml:lang="gb2312" lang="gb2312">
<head>
<title> ItemDataBoundGetColumnName </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="title" content="" />
<meta name="author" content="活靶子,Huobazi,www.github.com" />
<meta name="subject" content="" />
<meta name="language" content="gb2312" />
<meta name="keywords" content="" />
<meta name="Copyright" content="www.github.com" />
<meta name="robots" content="all" />
<script language="c#" runat="server">
void BindGrid()
{
        DataTable dt = new DataTable();
        DataRow dr;
        dt.Columns.Add(new DataColumn("IntegerValue", typeof(Int32)));
        dt.Columns.Add(new DataColumn("StringValue", typeof(string)));
        dt.Columns.Add(new DataColumn("DateTimeValue", typeof(DateTime)));
        dt.Columns.Add(new DataColumn("BoolValue", typeof(bool)));
        dt.Columns.Add(new DataColumn("CurrencyValue", typeof(double)));
        for (int i = 0; i < 36; i++) {
            dr = dt.NewRow();
            dr[0] = i;
            dr[1] = "项 " + i.ToString();
            dr[2] = DateTime.Now;
            dr[3] = (i % 2 != 0) ? true : false;
            dr[4] = 1.23 * (i+1);
            dt.Rows.Add(dr);
        }
  dg.DataSource= dt;
  dg.DataBind();
}
void Page_Load(object o, EventArgs e)
{
     dg.PagerStyle.Mode = PagerMode.NumericPages;
     if(!IsPostBack)
     {
        BindGrid();
     }
}
 
void btnClick(object o , EventArgs e)
{
     Response.Write("页面回发,但是不执行ItemDataBound");
}
 
void PageChange(object o , DataGridPageChangedEventArgs e)
{
     dg.CurrentPageIndex = e.NewPageIndex;
     BindGrid();
}
void ItemDataBound(object o , DataGridItemEventArgs e)
{
     if(e.Item.ItemIndex > -1 )//必须
     {
          DataRowView drv = (DataRowView)e.Item.DataItem;
          for (int i=0; i<drv.Row.Table.Columns.Count ; i++)
          {  
            Response.Write(drv.Row.Table.Columns[i].ColumnName + "  ");
          }
     }
}
</script>
 
</head>
<body>
<form runat="server">
  <ASP:DataGrid id="dg" runat="server"       
   HeaderStyle-BackColor="#aaaadd"
   AutoGenerateColumns="true"
   AllowPaging="true"
   PageSize="6"
    OnItemDataBound="ItemDataBound"
    OnPageIndexChanged="PageChange"
  >
  </asp:DataGrid>
  </br>
   <asp:button id="btn" runat="server" onclick="btnClick" Text="我是按钮,按我一下"></asp:button>
   <p>在AutoGenerateColumns="false"使用绑定列或者模板列的时候只需要使用 </P>
   <p><font color="blut">YourDataGrid.Columns[编号].HeaderText</font> 去获取
  </P>
</form>
</body>
</html>
 

05 Apr 2004

如何在ItemDataBound内获得DataGrid的列名称HeaderText

如果 AutoGenerateColumns=“false” 使用绑定列,模板列 则比较好办,直接使用 YourDataGrid.Columns[编号].HeaderText 获得 可是,如果 AutoGenerateColumns=“true” ,就比较麻烦了,因为这时YourDataGrid.Columns.Count是0 但是可以变通做到。

<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<!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" xml:lang="gb2312" lang="gb2312">
<head>
<title> ItemDataBoundGetColumnName </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="title" content="" />
<meta name="author" content="活靶子,Huobazi,www.github.com" />
<meta name="subject" content="" />
<meta name="language" content="gb2312" />
<meta name="keywords" content="" />
<meta name="Copyright" content="www.github.com" />
<meta name="robots" content="all" />
<script language="c#" runat="server">
void BindGrid()
{
        DataTable dt = new DataTable();
        DataRow dr;
        dt.Columns.Add(new DataColumn("IntegerValue", typeof(Int32)));
        dt.Columns.Add(new DataColumn("StringValue", typeof(string)));
        dt.Columns.Add(new DataColumn("DateTimeValue", typeof(DateTime)));
        dt.Columns.Add(new DataColumn("BoolValue", typeof(bool)));
        dt.Columns.Add(new DataColumn("CurrencyValue", typeof(double)));
        for (int i = 0; i < 36; i++) {
            dr = dt.NewRow();
            dr[0] = i;
            dr[1] = "项 " + i.ToString();
            dr[2] = DateTime.Now;
            dr[3] = (i % 2 != 0) ? true : false;
            dr[4] = 1.23 * (i+1);
            dt.Rows.Add(dr);
        }
  dg.DataSource= dt;
  dg.DataBind();
}
void Page_Load(object o, EventArgs e)
{
     dg.PagerStyle.Mode = PagerMode.NumericPages;
     if(!IsPostBack)
     {
        BindGrid();
     }
}
 
void btnClick(object o , EventArgs e)
{
     Response.Write("页面回发,但是不执行ItemDataBound");
}
 
void PageChange(object o , DataGridPageChangedEventArgs e)
{
     dg.CurrentPageIndex = e.NewPageIndex;
     BindGrid();
}
void ItemDataBound(object o , DataGridItemEventArgs e)
{
     if(e.Item.ItemIndex > -1 )//必须
     {
          DataRowView drv = (DataRowView)e.Item.DataItem;
          for (int i=0; i<drv.Row.Table.Columns.Count ; i++)
          {  
            Response.Write(drv.Row.Table.Columns[i].ColumnName + "  ");
          }
     }
}
</script>
 
</head>
<body>
<form runat="server">
  <ASP:DataGrid id="dg" runat="server"       
   HeaderStyle-BackColor="#aaaadd"
   AutoGenerateColumns="true"
   AllowPaging="true"
   PageSize="6"
    OnItemDataBound="ItemDataBound"
    OnPageIndexChanged="PageChange"
  >
  </asp:DataGrid>
  </br>
   <asp:button id="btn" runat="server" onclick="btnClick" Text="我是按钮,按我一下"></asp:button>
   <p>在AutoGenerateColumns="false"使用绑定列或者模板列的时候只需要使用 </P>
   <p><font color="blut">YourDataGrid.Columns[编号].HeaderText</font> 去获取
  </P>
</form>
</body>
</html>
 

05 Apr 2004

这次吵的更凶了!!

1 http://blog.joycode.com/5drush/posts/18249.aspx
从而引出
2 http://blog.codelphi.com/virushuo/posts/3453.aspx

http://blog.codelphi.com/netfire/posts/3469.aspx
我个人认为
MVPs是一群值得佩服的人,因为我身边就有一位 。如果你知道了他的一些情况你将更佩服他!
不同意文中“国内的大半都是靠论坛灌水得到”,
我认为热心于帮助别人的人最值得敬佩的!!!

14 Mar 2004

一个比较郁闷的问题

我在我的主页 http://www.github.com 内
文章显示页面是在添加文章的时候生成的静态htm页。
在首页和其他栏目显示文章列表时链接为
http://www.github.com/ShowArticle.Aspx?ID=214
这样的链接
在ShowArticle.Aspx内为文章的被阅读次数加1,跳转到(Response.Redirect)相应的Html文件

http://www.github.com/Files/71/66/20039280037.htm
最近发现这样的设计导致搜索引擎抓取不到页面
好友龙龙放出他的龙族蜘蛛在我的站内老是抓取不到任何可用链接,只能抓到首页就进行不下去了......
不只该如何解决,郁闷啊。

14 Mar 2004

一个比较郁闷的问题

我在我的主页 http://www.github.com 内
文章显示页面是在添加文章的时候生成的静态htm页。
在首页和其他栏目显示文章列表时链接为
http://www.github.com/ShowArticle.Aspx?ID=214
这样的链接
在ShowArticle.Aspx内为文章的被阅读次数加1,跳转到(Response.Redirect)相应的Html文件

http://www.github.com/Files/71/66/20039280037.htm
最近发现这样的设计导致搜索引擎抓取不到页面
好友龙龙放出他的龙族蜘蛛在我的站内老是抓取不到任何可用链接,只能抓到首页就进行不下去了......
不只该如何解决,郁闷啊。

14 Mar 2004

落伍者三周岁了

我常泡的一个论坛<<落伍者>>三周岁了,
小贺一下
公布我的AspxBoy.Com.Article的源代码
帖子在这里
源码在这里
希望各位指正。

04 Mar 2004

MessageBox Control in ASP.NET

在ASP.NET里实现MessageBox

http://www.microsoft.com/india/msdn/articles/119.aspx?










ShowMessageAtStartup
 
This control is used to show message at startup of the page. For example, if you want to inform the user with some information using message box after the post back. Then you can use this control. This control has following two properties,
 



MessageText: This property is used to set the Message which is showed in the message box.
Enabled: This property is used for enabling or disabling this control depending upon the
requirement.

 
MessageAtSubmit
 
This control is used to show alert message or confirm message box when the page is submitted. For example, when the user is pressing a button to delete a record. During that time, if you want to ask the user for confirmation. Then you can use this control. This control has following properties,
 








MessageText: This property is used to set the Message which is showed in the message box.
Enabled: This property is used for enabling or disabling this control depending upon the
requirement.
IsConfirmMessage: This property is used to mention whether it is confirmation message box or alert message box.
ConfirmMessagePassClientScript: This property is used to mention the client side script which has to executed if the confirmation message return true. i.e. when users presses ok button. This property will be used only when isConfirmmessage property is set to true
ConfirmMessageFailClientScript: This property is used to mention the client side script which
has to executed if the confirmation message return false. i.e. when users presses
cancel button. This property will be used only when isConfirmmessage property
is set to true.