天下無雙
阿龍 --质量是流程决定的。
var p = txts[txts.length-2].value;

 if (isNaN(q) isNaN(p))
  return;

 q = parseInt(q);
 p = parseFloat(p);

 txts[txts.length-1].value = (q * p).toFixed(2);
}
</script>

24.datagrid选定比较底下的行时,为什么总是刷新一下,然后就滚动到了最上面,刚才选定的行因屏幕的关系就看不到了。

page_load
page.smartNavigation=true
  25.在Datagrid中修改数据,当点击编辑键时,数据出现在文本框中,怎么控制文本框的大小 ?

private void DataGrid1_ItemDataBound(obj sender,DataGridItemEventArgs e)
{
 for(int i=0;i<e.Item.Cells.Count-1;i++)
  if(e.Item.ItemType==ListItemType.EditType)
  {
   e.Item.Cells[i].Attributes.Add("Width", "80px")
  }
}
  26.对话框

private static string ScriptBegin = "<script language=\"JavaScript\">";
private static string ScriptEnd = "</script>";

public static void ConfirmMessageBox(string PageTarget,string Content)
{
 string ConfirmContent="var retValue=window.confirm(’"+Content+"’);"+"if(retValue){window.location=’"+PageTarget+"’;}";

 ConfirmContent=ScriptBegin + ConfirmContent + ScriptEnd;

 Page ParameterPage = (Page)System.Web.HttpContext.Current.Handler;
 ParameterPage.RegisterStartupScript("confirm",ConfirmContent);
 //Response.Write(strScript);
}

    27. 将时间格式化:string aa=DateTime.Now.ToString("yyyy年MM月dd日");

  1.1 取当前年月日时分秒

currentTime=System.DateTime.Now;
  1.2 取当前年

int 年= DateTime.Now.Year;
  1.3 取当前月

int 月= DateTime.Now.Month;
  1.4 取当前日

int 日= DateTime.Now.Day;
  1.5 取当前时

int 时= DateTime.Now.Hour;
  1.6 取当前分

int 分= DateTime.Now.Minute;
  1.7 取当前秒

int 秒= DateTime.Now.Second;
  1.8 取当前毫秒

int 毫秒= DateTime.Now.Millisecond;
  28.自定义分页代码:

posted on 2007-07-21 11:28  阿龍  阅读(128)  评论(0编辑  收藏  举报