如果datagrid中的某一列不帮定的话,是否可以对这一列中的cell进行数据添加???

realfishhook 2003-10-18 10:28:55
问题描述:
数据库的表A中,有一个字段存储的是id(参照其它的表B中的id存在的,而在参照的表B中,id对应着一个name)。

我在用datagrid榜定到表A的时候(榜定用的是adodc),由于A表中只有id,但是我还要显示对应的name(在B表中,为了方便用户),所以我就在datagrid中多设置了一列,想要在数据都显示在datagrid中之后(数据的显示都已经成功),根据每一行的id,在对应的name列中显示出相应的名称(由代码实现)。
但是试验了一些方法,都不行。

#############
问题:
#############
如果datagrid中的某一列不帮定的话,是否可以对这一列中的cell进行数据添加???
谢谢先!!!!!!
...全文
30 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
realfishhook 2003-10-21
  • 打赏
  • 举报
回复
其实,我的本意就是想可以直接用adodb 的addnew,delete,update这些方法
省事阿
但是,一个相关的字段带来了麻烦,客户要看到的是名称,编号对他们来说是没有用的。
但是如果把相关的那个字段引进来,添加就产生错误了。
所以就想在纪录读取之后,遍历纪录,根据编号,将名称匹配上显示出来。但就是没办法向datagrid中非帮订的列中添加数据。


我想知道,我的这种想法真的不可行吗???
当然,我知道编码的方式是肯定行得通的,而且很灵活。
caojianan 2003-10-20
  • 打赏
  • 举报
回复

新建视图,
create View Name AS
SELECT a.字段 ,b.字段 FROM 表a,表b
WHERE a.id=b.id。
如是 ACCESS 库,新建 查询

rs.open "select * from 视图 ",cn
set datagrid.datasource=rs

neuboy 2003-10-20
  • 打赏
  • 举报
回复
yoki(小马哥) 说得对,可以实现的,

coding可不要怕麻烦阿 哈哈!
yoki 2003-10-18
  • 打赏
  • 举报
回复
没有必要,在查询里直接关联即可
rs.open "select a.* ,b.name from a,b where a.id=b.id",cn
set datagrid.datasource=rs
rs.close
realfishhook 2003-10-18
  • 打赏
  • 举报
回复
这倒是可以
但是我想通过adodc直接就可以update,delete,addnew了
不用些什么代码了(懒了)。
请问,那一列不帮定的话,有没有办法可以写进去东西阿????
表格控件总览:   在VB开发环境,表格控件在界面开发元素占有重要的地位。它不仅有外观整洁、表达形式规范的优点,而且更重要的是它较高的信息表现率(就是相对于其他控件来说能够表达更多的信息),随着信息时代的到来,它的应用将更加的广泛。    那么在VB平台下,如何操作这一功能强大的控件元素呢?事实上我们知道,VB平台下面的表格控件是相当丰富的,总结下来提供了4种类型:Microsoft Data Bound grid Control、Microsoft Datagrid Control、Microsoft Flexgrid Control、Microsoft Hierarchial Flexgrid Control. 这四种表格各有其特点,下面我们一一讨论。   1. Microsoft Data Bound grid Control   此控件主要用于数据绑定(可以不绑定,但是因为不提供对单个cell的控制支持,所以实际上这样做是不经济的)。具体说来,就是数据源比较固定的情况下可以使用这种控件。   具体使用方法是设定此控件的datasource属性,就可以不用编写任何代码就可以显示该数据源所指向的记录数据。比如可以将datasource设置为一个data控件,而data控件又指向数据库"成绩"的 一个"语文"表,那么当程序运行时,它就自动显示此"语文"表的数据。 基本步骤如下: 1、向工程上添加Microsoft Data Bound Grid Control控件,即DBGrid控件。 2、在窗体上添加DBGrid控件DBGrid1和Data控件Data1。 3、设置Data1的DatabaseName属性为你要看的数据库的名字。 4、设置Data1的RecordSource属性为表的名字或合法的SQL Select语句。 5、设置DBGrid1的DataSource属性为Data1。   从上面的分析看得出来,这个控件虽然操作方便,但是它也有局限性,就是不能对显示的数据进行灵活的控制操作,比如有些数据允许用户修改,有些数据却不允许用户修改,而此控件却只能提供全部数据源的原子操作:即要么全部允许修改,要么就全部不允许。还有另外此控件也不提供对单个单元格(cell进行操作,所以提供不了更为个性化的界面风格。   2. Microsoft Datagrid Control   此控件跟前面介绍的Data Bound grid Control控件很相似,也是主要进行绑定操作,而缺点和Data Bound grid Control完全一样。但是它跟Data Bound grid Control不一样的是其数据源的驱动引擎只能是OLEDB形式的,不能是DAO,比如就可以使用ADO数据控件,不能使用DATA控件。而Data Bound grid Control却刚好和它相反,这一点在开发一定要注意。   3. Microsoft Flexgrid Control与Microsoft Hierarchial Flexgrid Control.   这里重点介绍这两种控件,因为在实际开发,这两种控件应用的场合更多一些,它不仅能够反映数据,而且也能把数据的修改信息反映到数据去,所以弥补了上述两种控件的不足。   如果数据不需要修改,那么可以进行绑定操作,其方法跟前面介绍的完全一样,就是通过设置DataSource属性来完成数据的显示工作。但是实际开发,需要对整个表格控件更为灵活的显示控制。   在给出例程之前,有必要对这一控件进行比较详尽的认识:这种控件允许将文本或者图象放置于每个单元格之,控件的Row与Col属性允许用户在代码指定当前行和列,当然也可通过操作鼠标和键盘来改变这两个属性,而text属性指明当前单元格的文本。如果单元格的文本太长而不能完全显示出来的话,可以通过将WordWrap属性设置为true来达到显示的目的。下面将比较重要的属性小结如下:   DataSource---------用来指定需要绑定的数据源,比如data控件。   Cellpicture----------用来设定当前单元格的图象,便于显示该图象。此属性不能在设计时使用。   Col,Row---------------设定当前列和当前行,注意它们均是从0开始的,如果同时设定它们,可以指定当前的单元格。设计时也不能使用。   Cols,Rows---------------设置表格控件总的列数和行数。   Hwnd---------------表格句柄,可以结合Windows API对表格控件进行更高级的控制。   Text---------------指定当前的单元格的文本内容。   TextMatrix(i,j)-------此属性比较重要,它用来指定第I行和第j列所确定的单元格的文本内容。它等价于下面的代码: MSHFlexGrid1.Rows =i MSHFlexGrid1.Cols =j MSHFlexGrid1.Text =指定的字符串   WordWrap-------为ture时可以在当前单元格换行显示,否则如果要显示的字符的长度超过列宽,那么就不能显示完全。
ASP.NET程序常用的三十三种代码 1. 打开新的窗口并传送参数:   传送参数: response.write("window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)")   接收参数: string a = Request.QueryString("id"); string b = Request.QueryString("id1");   2.为按钮添加对话框 Button1.Attributes.Add("onclick","return confirm(’确认?’)"); button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}")   3.删除表格选定记录 int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString()   4.删除表格记录警告 private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) {  switch(e.Item.ItemType)  {   case ListItemType.Item :   case ListItemType.AlternatingItem :   case ListItemType.EditItem:    TableCell myTableCell;    myTableCell = e.Item.Cells[14];    LinkButton myDeleteButton ;    myDeleteButton = (LinkButton)myTableCell.Controls[0];    myDeleteButton.Attributes.Add("onclick","return confirm(’您是否确定要删除这条信息’);");    break;   default:    break;  } }   5.点击表格行链接另一页 private void grdCustomer_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) {  //点击表格打开  if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)   e.Item.Attributes.Add("onclick","window.open(’Default.aspx?id=" + e.Item.Cells[0].Text + "’);"); }   双击表格连接到另一页   在itemDataBind事件 if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) {  string OrderItemID =e.item.cells[1].Text;  ...  e.item.Attributes.Add("ondblclick", "location.href=’../ShippedGrid.aspx?id=" + OrderItemID + "’"); }   双击表格打开新一页 if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) {  string OrderItemID =e.item.cells[1].Text;  ...  e.item.Attributes.Add("ondblclick", "open(’../ShippedGrid.aspx?id=" + OrderItemID + "’)"); }   ★特别注意:【?id=】 处不能为 【?id =】   6.表格超连接列传递参数 DataGrid的_ItemDataBound里 if (e.Item.ItemType == ListItemType.Item ||e.Item.ItemType == ListItemType.AlternatingItem) { e.Item.Attributes.Add("onmouseover","this.style.backgroundColor=’#99cc00’;    this.style.color=’buttontext’;this.style.cursor=’default’;"); e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=’’;this.style.color=’’;"); }   8.关于日期格式   日期格式设定 DataFormatString="{0:yyyy-MM-dd}"   我觉得应该在itembound事件 e.items.cell["你的列"].text=DateTime.Parse(e.items.cell["你的列"].text.ToString("yyyy-MM-dd"))   9.获取错误信息并到指定页面   不要使用Response.Redirect,而应该使用Server.Transfer   e.g // in global.asax protected void Application_Error(Object sender, EventArgs e) { if (Server.GetLastError() is HttpUnhandledException) Server.Transfer("MyErrorPage.aspx"); //其余的非HttpUnhandledException异常交给ASP.NET自己处理就okay了 :) }   Redirect会导致post-back的产生从而丢失了错误信息,所以页面导向应该直接在服务器端执行,这样就可以在错误处理页面得到出错信息并进行相应的处理   10.清空Cookie Cookie.Expires=[DateTime]; Response.Cookies("UserName").Expires = 0   11.自定义异常处理 //自定义异常处理类 using System; using System.Diagnostics; namespace MyAppException {  ///  /// 从系统异常类ApplicationException继承的应用程序异常处理类。  /// 自动将异常内容记录到Windows NT/2000的应用程序日志  ///  public class AppException:System.ApplicationException  {   public AppException()   {    if (ApplicationConfiguration.EventLogEnabled)LogEvent("出现一个未知错误。");   }  public AppException(string message)  {   LogEvent(message);  }  public AppException(string message,Exception innerException)  {   LogEvent(message);   if (innerException != null)   {    LogEvent(innerException.Message);   }  }  //日志记录类  using System;  using System.Configuration;  using System.Diagnostics;  using System.IO;  using System.Text;  using System.Threading;  namespace MyEventLog  {   ///   /// 事件日志记录类,提供事件日志记录支持   ///   /// 定义了4个日志记录方法 (error, warning, info, trace)   ///   ///   public class ApplicationLog   {    ///    /// 将错误信息记录到Win2000/NT事件日志    /// 需要记录的文本信息    ///    public static void WriteError(String message)    {     WriteLog(TraceLevel.Error, message);    }    ///    /// 将警告信息记录到Win2000/NT事件日志    /// 需要记录的文本信息    ///    public static void WriteWarning(String message)    {     WriteLog(TraceLevel.Warning, message);      }    ///    /// 将提示信息记录到Win2000/NT事件日志    /// 需要记录的文本信息    ///    public static void WriteInfo(String message)    {     WriteLog(TraceLevel.Info, message);    }    ///    /// 将跟踪信息记录到Win2000/NT事件日志    /// 需要记录的文本信息    ///    public static void WriteTrace(String message)    {     WriteLog(TraceLevel.Verbose, message);    }    ///    /// 格式化记录到事件日志的文本信息格式    /// 需要格式化的异常对象    /// 异常信息标题字符串.    ///    /// 格式后的异常信息字符串,包括异常内容和跟踪堆栈.    ///    ///    public static String FormatException(Exception ex, String catchInfo)    {     StringBuilder strBuilder = new StringBuilder();     if (catchInfo != String.Empty)     {      strBuilder.Append(catchInfo).Append("\r\n");     }     strBuilder.Append(ex.Message).Append("\r\n").Append(ex.StackTrace);     return strBuilder.ToString();    }    ///    /// 实际事件日志写入方法    /// 要记录信息的级别(error,warning,info,trace).    /// 要记录的文本.    ///    private static void WriteLog(TraceLevel level, String messageText)    {     try     {      EventLogEntryType LogEntryType;      switch (level)      {       case TraceLevel.Error:        LogEntryType = EventLogEntryType.Error;        break;       case TraceLevel.Warning:        LogEntryType = EventLogEntryType.Warning;        break;       case TraceLevel.Info:        LogEntryType = EventLogEntryType.Information;        break;       case TraceLevel.Verbose:        LogEntryType = EventLogEntryType.SuccessAudit;        break;       default:        LogEntryType = EventLogEntryType.SuccessAudit;        break;      }      EventLog eventLog = new EventLog("Application", ApplicationConfiguration.EventLogMachineName, ApplicationConfiguration.EventLogSourceName );      //写入事件日志      eventLog.WriteEntry(messageText, LogEntryType);     }    catch {} //忽略任何异常   }  } //class ApplicationLog }   12.Panel 横向滚动,纵向自动扩展   13.回车转换成Tab  if (event.keyCode==13 && event.srcElement.type!=’button’ && event.srcElement.type! =’submit’ &&     event.srcElement.type!=’reset’ && event.srcElement.type!=’’&& event.srcElement.type!=’textarea’);    event.keyCode=9; onkeydown="if(event.keyCode==13) event.keyCode=9"   14.DataGrid超级连接列 DataNavigateUrlField="字段名" DataNavigateUrlFormatString="http://xx/inc/delete.aspx?ID={0}"   15.DataGrid行随鼠标变色 private void DGzf_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) {  if (e.Item.ItemType!=ListItemType.Header)  {   e.Item.Attributes.Add( "onmouseout","this.style.backgroundColor=\""+e.Item.Style["BACKGROUND-COLOR"]+"\"");   e.Item.Attributes.Add( "onmouseover","this.style.backgroundColor=\""+ "#EFF3F7"+"\"");  } }   16.模板列   后台代码 protected void CheckAll_CheckedChanged(object sender, System.EventArgs e) {  //改变列的选定,实现全选或全不选。  CheckBox chkExport ;  if( CheckAll.Checked)  {   foreach(DataGridItem oDataGridItem in MyDataGrid.Items)   {    chkExport = (CheckBox)oDataGridItem.FindControl("chkExport");    chkExport.Checked = true;   }  }  else  {   foreach(DataGridItem oDataGridItem in MyDataGrid.Items)   {    chkExport = (CheckBox)oDataGridItem.FindControl("chkExport");    chkExport.Checked = false;   }  } }   17.数字格式化   【的结果是500.0000,怎样格式化为500.00?】 int i=123456; string s=i.ToString("###,###.00");   18.日期格式化   【aspx页面内:   显示为: 2004-8-11 19:44:28   我只想要:2004-8-11 】   应该如何改?   【格式化日期】   取出来,一般是 object((DateTime)objectFromDB).ToString("yyyy-MM-dd");   【日期的验证表达式】   A.以下正确的输入格式: [2004-2-29], [2004-02-29 10:29:39 pm], [2004/12/31] ^((\d{2}(([02468][048])|([13579][26]))[\-\/\s]?((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|([1-2][0-9])))))|(\d{2}(([02468][1235679])|([13579][01345789]))[\-\/\s]?((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\s(((0?[1-9])|(1[0-2]))\:([0-5][0-9])((\s)|(\:([0-5][0-9])\s))([AM|PM|am|pm]{2,2})))?$   B.以下正确的输入格式:[0001-12-31], [9999 09 30], [2002/03/03] ^\d{4}[\-\/\s]?((((0[13578])|(1[02]))[\-\/\s]?(([0-2][0-9])|(3[01])))|(((0[469])|(11))[\-\/\s]?(([0-2][0-9])|(30)))|(02[\-\/\s]?[0-2][0-9]))$   【大小写转换】 HttpUtility.HtmlEncode(string); HttpUtility.HtmlDecode(string)   19.如何设定全局变量   Global.asax   Application_Start()事件   添加Application[属性名] = xxx;   就是你的全局变量   20.怎样作到HyperLinkColumn生成的连接后,点击连接,打开新窗口?   HyperLinkColumn有个属性Target,将器值设置成"_blank"即可.(Target="_blank")   【ASPNETMENU】点击菜单项弹出新窗口   在你的menuData.xml文件的菜单项加入URLTarget="_blank",如: ......   最好将你的aspnetmenu升级到1.2版   21.读取DataGrid控件TextBox值 foreach(DataGrid dgi in yourDataGrid.Items) {  TextBox tb = (TextBox)dgi.FindControl("yourTextBoxId");  tb.Text.... }   23.在DataGrid有3个模板列包含Textbox分别为 DG_ShuLiang (数量) DG_DanJian(单价) DG_JinE (金额)分别在5.6.7列,要求在录入数量及单价的时候自动算出金额即:数量*单价=金额还要求录入时限制为 数值型.我如何用客户端脚本实现这个功能?   〖思归〗 function DoCal() {  var e = event.srcElement;  var row = e.parentNode.parentNode;  var txts = row.all.tags("INPUT");  if (!txts.length || txts.length < 3)   return;  var q = txts[txts.length-3].value;  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); }   24.datagrid选定比较底下的行时,为什么总是刷新一下,然后就滚动到了最上面,刚才选定的行因屏幕的关系就看不到了。 page_load page.smartNavigation=true   25.在Datagrid修改数据,当点击编辑键时,数据出现在文本框,怎么控制文本框的大小 ? private void DataGrid1_ItemDataBound(obj sender,DataGridItemEventArgs e) {  for(int i=0;iCells.Count-1;i++)   if(e.Item.ItemType==ListItemType.EditType)   {    e.Item.Cells[i].Attributes.Add("Width", "80px")   } }   26.对话框 private static string ScriptBegin = ""; private static string ScriptEnd = ""; 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.自定义分页代码:   先定义变量 : public static int pageCount; //总页面数 public static int curPageIndex=1; //当前页面   下一页: if(DataGrid1.CurrentPageIndex 0) {  DataGrid1.CurrentPageIndex += 1;  curPageIndex-=1; } bind(); // DataGrid1数据绑定函数   直接页面跳转: int a=int.Parse(JumpPage.Value.Trim());//JumpPage.Value.Trim()为跳转值 if(a<DataGrid1.PageCount) {  this.DataGrid1.CurrentPageIndex=a; } bind();   29.DataGrid使用:   添加删除确认: private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) {  foreach(DataGridItem di in this.DataGrid1.Items)  {   if(di.ItemType==ListItemType.Item||di.ItemType==ListItemType.AlternatingItem)   {    ((LinkButton)di.Cells[8].Controls[0]).Attributes.Add("onclick","return confirm(’确认删除此项吗?’);");   }  } }   样式交替: ListItemType itemType = e.Item.ItemType; if (itemType == ListItemType.Item ) {  e.Item.Attributes["onmouseout"] = "javascript:this.style.backgroundColor=’#FFFFFF’;";  e.Item.Attributes["onmouseover"] = "javascript:this.style.backgroundColor=’#d9ece1’;cursor=’hand’;" ; } else if( itemType == ListItemType.AlternatingItem) {  e.Item.Attributes["onmouseout"] = "javascript:this.style.backgroundColor=’#a0d7c4’;";  e.Item.Attributes["onmouseover"] = "javascript:this.style.backgroundColor=’#d9ece1’;cursor=’hand’;" ; }   添加一个编号列: DataTable dt= c.ExecuteRtnTableForAccess(sqltxt); //执行sql返回的DataTable DataColumn dc=dt.Columns.Add("number",System.Type.GetType("System.String")); for(int i=0;iDataGrid1.DataSource=dt; DataGrid1.DataBind();   DataGrid1添加一个CheckBox,页面添加一个全选框 private void CheckBox2_CheckedChanged(object sender, System.EventArgs e) {  foreach(DataGridItem thisitem in DataGrid1.Items)  {   ((CheckBox)thisitem.Cells[0].Controls[1]).Checked=CheckBox2.Checked;  } }   将当前页面DataGrid1显示的数据全部删除 foreach(DataGridItem thisitem in DataGrid1.Items) {  if(((CheckBox)thisitem.Cells[0].Controls[1]).Checked)  {   string strloginid= DataGrid1.DataKeys[thisitem.ItemIndex].ToString();   Del (strloginid); //删除函数  } }   30.当文件在不同目录下,需要获取数据库连接字符串(如果连接字符串放在Web.config,然后在Global.asax初始化)   在Application_Start添加以下代码: Application["ConnStr"]=this.Context.Request.PhysicalApplicationPath+ConfigurationSettings.    AppSettings["ConnStr"].ToString();   31. 变量.ToString()   字符型转换 转为字符串 12345.ToString("n"); //生成 12,345.00 12345.ToString("C"); //生成 ¥12,345.00 12345.ToString("e"); //生成 1.234500e+004 12345.ToString("f4"); //生成 12345.0000 12345.ToString("x"); //生成 3039 (16进制) 12345.ToString("p"); //生成 1,234,500.00%   32、变量.Substring(参数1,参数2);   截取字串的一部分,参数1为左起始位数,参数2为截取几位。 如:string s1 = str.Substring(0,2);   33.在自己的网站上登陆其他网站:(如果你的页面是通过嵌套方式的话,因为一个页面只能有一个FORM,这时可以导向另外一个页面再提交登陆信息)   文本框的名称必须是你要登陆的网页上的名称,如果源码不行可以用vsniffer 看看。   下面是获取用户输入的登陆信息的代码: string name; name=Request.QueryString["EmailName"]; try {  int a=name.IndexOf("@",0,name.Length);  f_user.Value=name.Substring(0,a);  f_domain.Value=name.Substring(a+1,name.Length-(a+1));  f_pass.Value=Request.QueryString["Psw"]; } catch {  Script.Alert("错误的邮箱!");  Server.Transfer("index.aspx"); }
ASP.NET常用代码 1. 打开新的窗口并传送参数: 传送参数: response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')添加对话框 传送参数: response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')添加对话框 Button1.Attributes.Add("onclick","return confirm('确认?')"); button.attributes.add("onclick","if(confirm('are you sure...?')){return true;}else{return false;}") 3.删除表格选定记录 int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() 4.删除表格记录警告 private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) { switch(e.Item.ItemType) { case ListItemType.Item : case ListItemType.AlternatingItem : case ListItemType.EditItem: TableCell myTableCell; myTableCell = e.Item.Cells[14]; LinkButton myDeleteButton ; myDeleteButton = (LinkButton)myTableCell.Controls[0]; myDeleteButton.Attributes.Add("onclick","return confirm('您是否确定要删除这条信息');"); break; default: break; } } 5.点击表格行链接另一页 private void grdCustomer_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { //点击表格打开 if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) e.Item.Attributes.Add("onclick","window.open('Default.aspx?id=" + e.Item.Cells[0].Text + "');"); } 双击表格连接到另一页 在itemDataBind事件 if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { string OrderItemID =e.item.cells[1].Text; ... e.item.Attributes.Add("ondblclick", "location.href='../ShippedGrid.aspx?id=" + OrderItemID + "'"); } 双击表格打开新一页 if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { string OrderItemID =e.item.cells[1].Text; ... e.item.Attributes.Add("ondblclick", "open('../ShippedGrid.aspx?id=" + OrderItemID + "')"); } ★特别注意:【?id=】 处不能为 【?id =】 6.表格超连接列传递参数 数据字段1")%>' & name='<%# DataBinder.Eval(Container.DataItem, "数据字段2")%>' /> 7.表格点击改变颜色 if (e.Item.ItemType == ListItemType.Item ||e.Item.ItemType == ListItemType.AlternatingItem) { e.Item.Attributes.Add("onclick","this.style.backgroundColor='#99cc00';this.style.color='buttontext';this.style.cursor='default';"); } 写在DataGrid的_ItemDataBound里 if (e.Item.ItemType == ListItemType.Item ||e.Item.ItemType == ListItemType.AlternatingItem) { e.Item.Attributes.Add("onmouseover","this.style.backgroundColor='#99cc00';this.style.color='buttontext';this.style.cursor='default';"); e.Item.Attributes.Add("onmouseout","this.style.backgroundColor='';this.style.color='';"); } 8.关于日期格式 日期格式设定 DataFormatString="{0:yyyy-MM-dd}" 我觉得应该在itembound事件 e.items.cell["你的列"].text=DateTime.Parse(e.items.cell["你的列"].text.ToString("yyyy-MM-dd")) 9.获取错误信息并到指定页面 不要使用Response.Redirect,而应该使用Server.Transfer e.g // in global.asax protected void Application_Error(Object sender, EventArgs e) { if (Server.GetLastError() is HttpUnhandledException) Server.Transfer("MyErrorPage.aspx"); //其余的非HttpUnhandledException异常交给ASP.NET自己处理就okay了 :) } Redirect会导致post-back的产生从而丢失了错误信息,所以页面导向应该直接在服务器端执行,这样就可以在错误处理页面得到出错信息并进行相应的处理 10.清空Cookie Cookie.Expires=[DateTime]; Response.Cookies("UserName").Expires = 0 11.自定义异常处理 //自定义异常处理类 using System; using System.Diagnostics; namespace MyAppException { /// /// 从系统异常类ApplicationException继承的应用程序异常处理类。 /// 自动将异常内容记录到Windows NT/2000的应用程序日志 /// public class AppException:System.ApplicationException { public AppException() { if (ApplicationConfiguration.EventLogEnabled) LogEvent("出现一个未知错误。"); } public AppException(string message) { LogEvent(message); } public AppException(string message,Exception innerException) { LogEvent(message); if (innerException != null) { LogEvent(innerException.Message); } } //日志记录类 using System; using System.Configuration; using System.Diagnostics; using System.IO; using System.Text; using System.Threading; namespace MyEventLog { /// /// 事件日志记录类,提供事件日志记录支持 /// /// 定义了4个日志记录方法 (error, warning, info, trace) /// /// public class ApplicationLog { /// /// 将错误信息记录到Win2000/NT事件日志 /// 需要记录的文本信息 /// public static void WriteError(String message) { WriteLog(TraceLevel.Error, message); } /// /// 将警告信息记录到Win2000/NT事件日志 /// 需要记录的文本信息 /// public static void WriteWarning(String message) { WriteLog(TraceLevel.Warning, message); } /// /// 将提示信息记录到Win2000/NT事件日志 /// 需要记录的文本信息 /// public static void WriteInfo(String message) { WriteLog(TraceLevel.Info, message); } /// /// 将跟踪信息记录到Win2000/NT事件日志 /// 需要记录的文本信息 /// public static void WriteTrace(String message) { WriteLog(TraceLevel.Verbose, message); } /// /// 格式化记录到事件日志的文本信息格式 /// 需要格式化的异常对象 /// 异常信息标题字符串. /// /// 格式后的异常信息字符串,包括异常内容和跟踪堆栈. /// /// public static String FormatException(Exception ex, String catchInfo) { StringBuilder strBuilder = new StringBuilder(); if (catchInfo != String.Empty) { strBuilder.Append(catchInfo).Append("\r\n"); } strBuilder.Append(ex.Message).Append("\r\n").Append(ex.StackTrace); return strBuilder.ToString(); } /// /// 实际事件日志写入方法 /// 要记录信息的级别(error,warning,info,trace). /// 要记录的文本. /// private static void WriteLog(TraceLevel level, String messageText) { try { EventLogEntryType LogEntryType; switch (level) { case TraceLevel.Error: LogEntryType = EventLogEntryType.Error; break; case TraceLevel.Warning: LogEntryType = EventLogEntryType.Warning; break; case TraceLevel.Inf LogEntryType = EventLogEntryType.Information; break; case TraceLevel.Verbose: LogEntryType = EventLogEntryType.SuccessAudit; break; default: LogEntryType = EventLogEntryType.SuccessAudit; break; } EventLog eventLog = new EventLog("Application", ApplicationConfiguration.EventLogMachineName, ApplicationConfiguration.EventLogSourceName ); //写入事件日志 eventLog.WriteEntry(messageText, LogEntryType); } catch {} //忽略任何异常 } } //class ApplicationLog } 12.Panel 横向滚动,纵向自动扩展 13.回车转换成Tab <script language="javascript" for="document" event="onkeydown"> if(event.keyCode==13 && event.srcElement.type!='button' && event.srcElement.type!='submit' && event.srcElement.type!='reset' && event.srcElement.type!=''&& event.srcElement.type!='textarea'); event.keyCode=9; DataGrid超级连接列 DataNavigateUrlField="字段名" DataNavigateUrlFormatString="http://xx/inc/delete.aspx?ID={0}" 15.DataGrid行随鼠标变色 private void DGzf_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if (e.Item.ItemType!=ListItemType.Header) { e.Item.Attributes.Add( "onmouseout","this.style.backgroundColor=\""+e.Item.Style["BACKGROUND-COLOR"]+"\""); e.Item.Attributes.Add( "onmouseover","this.style.backgroundColor=\""+ "#EFF3F7"+"\""); } } 16.模板列 后台代码 protected void CheckAll_CheckedChanged(object sender, System.EventArgs e) { //改变列的选定,实现全选或全不选。 CheckBox chkExport ; if( CheckAll.Checked) { foreach(DataGridItem oDataGridItem in MyDataGrid.Items) { chkExport = (CheckBox)oDataGridItem.FindControl("chkExport"); chkExport.Checked = true; } } else { foreach(DataGridItem oDataGridItem in MyDataGrid.Items) { chkExport = (CheckBox)oDataGridItem.FindControl("chkExport"); chkExport.Checked = false; } } } 17.数字格式化 【<%#Container.DataItem("price")%>的结果是500.0000,怎样格式化为500.00?】 <%#Container.DataItem("price","{0:¥#,##0.00}")%> int i=123456; string s=i.ToString("###,###.00"); 18.日期格式化 【aspx页面内:<%# DataBinder.Eval(Container.DataItem,"Company_Ureg_Date")%> 显示为: 2004-8-11 19:44:28 我只想要:2004-8-11 】 <%# DataBinder.Eval(Container.DataItem,"Company_Ureg_Date","{0:yyyy-M-d}")%> 应该如何改? 【格式化日期】 取出来,一般是object ((DateTime)objectFromDB).ToString("yyyy-MM-dd"); 【日期的验证表达式】 A.以下正确的输入格式: [2004-2-29], [2004-02-29 10:29:39 pm], [2004/12/31] ^((\d{2}(([02468][048])|([13579][26]))[\-\/\s]?((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|([1-2][0-9])))))|(\d{2}(([02468][1235679])|([13579][01345789]))[\-\/\s]?((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\s(((0?[1-9])|(1[0-2]))\:([0-5][0-9])((\s)|(\:([0-5][0-9])\s))([AM|PM|am|pm]{2,2})))?$ B.以下正确的输入格式:[0001-12-31], [9999 09 30], [2002/03/03] ^\d{4}[\-\/\s]?((((0[13578])|(1[02]))[\-\/\s]?(([0-2][0-9])|(3[01])))|(((0[469])|(11))[\-\/\s]?(([0-2][0-9])|(30)))|(02[\-\/\s]?[0-2][0-9]))$ 【大小写转换】 HttpUtility.HtmlEncode(string); HttpUtility.HtmlDecode(string) 19.如何设定全局变量 Global.asax Application_Start()事件 添加Application[属性名] = xxx; 就是你的全局变量 20.怎样作到HyperLinkColumn生成的连接后,点击连接,打开新窗口? HyperLinkColumn有个属性Target,将器值设置成"_blank"即可.(Target="_blank") 【ASPNETMENU】点击菜单项弹出新窗口 在你的menuData.xml文件的菜单项加入URLTarget="_blank" 如: ...... 最好将你的aspnetmenu升级到1.2版 21.委托讨论 http://community.csdn.net/Expert/topic/2651/2651579.xml?temp=.7183191 http://dev.csdn.net/develop/article/22/22951.shtm 22.读取DataGrid控件TextBox值 foreach(DataGrid dgi in yourDataGrid.Items) { TextBox tb = (TextBox)dgi.FindControl("yourTextBoxId"); tb.Text.... } 23.在DataGrid有3个模板列包含Textbox分别为 DG_ShuLiang (数量) DG_DanJian(单价) DG_JinE(金额)分别在5.6.7列,要求在录入数量及单价的时候自动算出金额即:数量*单价=金额还要求录入时限制为数值型.我如何用客户端脚本实现这个功能? 〖思归〗 <script language="javascript"> function DoCal() { var e = event.srcElement; var row = e.parentNode.parentNode; var txts = row.all.tags("INPUT"); if (!txts.length || txts.length < 3) return; var q = txts[txts.length-3].value; 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); } datagrid选定比较底下的行时,为什么总是刷新一下,然后就滚动到了最上面,刚才选定的行因屏幕的关系就看不到了 page_load page.smartNavigation=true 25.在Datagrid修改数据,当点击编辑键时,数据出现在文本框,怎么控制文本框的大小 ? private void DataGrid1_ItemDataBound(obj sender,DataGridItemEventArgs e) { for(int i=0;iCells.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 = "DataGrid1.CurrentPageIndex < (DataGrid1.PageCount - 1)) { DataGrid1.CurrentPageIndex += 1; curPageIndex+=1; } bind(); // DataGrid1数据绑定函数 上一页: if(DataGrid1.CurrentPageIndex >0) { DataGrid1.CurrentPageIndex += 1; curPageIndex-=1; } bind(); // DataGrid1数据绑定函数 直接页面跳转: int a=int.Parse(JumpPage.Value.Trim());//JumpPage.Value.Trim()为跳转值 if(a<DataGrid1.PageCount) { this.DataGrid1.CurrentPageIndex=a; } bind(); 29.DataGrid使用: 3.1添加删除确认: private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { foreach(DataGridItem di in this.DataGrid1.Items) { if(di.ItemType==ListItemType.Item||di.ItemType==ListItemType.AlternatingItem) { ((LinkButton)di.Cells[8].Controls[0]).Attributes.Add("onclick","return confirm('确认删除此项吗?');"); } } } 3.2样式交替: ListItemType itemType = e.Item.ItemType; if (itemType == ListItemType.Item ) { e.Item.Attributes["onmouseout"] = "javascript:this.style.backgroundColor='#FFFFFF';"; e.Item.Attributes["onmouseover"] = "javascript:this.style.backgroundColor='#d9ece1';cursor='hand';" ; } else if( itemType == ListItemType.AlternatingItem) { e.Item.Attributes["onmouseout"] = "javascript:this.style.backgroundColor='#a0d7c4';"; e.Item.Attributes["onmouseover"] = "javascript:this.style.backgroundColor='#d9ece1';cursor='hand';" ; } 3.3添加一个编号列: DataTable dt= c.ExecuteRtnTableForAccess(sqltxt); //执行sql返回的DataTable DataColumn dc=dt.Columns.Add("number",System.Type.GetType("System.String")); for(int i=0;iDataGrid1.DataSource=dt; DataGrid1.DataBind(); 3.4 DataGrid1添加一个CheckBox,页面添加一个全选框 private void CheckBox2_CheckedChanged(object sender, System.EventArgs e) { foreach(DataGridItem thisitem in DataGrid1.Items) { ((CheckBox)thisitem.Cells[0].Controls[1]).Checked=CheckBox2.Checked; } } 将当前页面DataGrid1显示的数据全部删除 foreach(DataGridItem thisitem in DataGrid1.Items) { if(((CheckBox)thisitem.Cells[0].Controls[1]).Checked) { string strloginid= DataGrid1.DataKeys[thisitem.ItemIndex].ToString(); Del (strloginid); //删除函数 } } 30.当文件在不同目录下,需要获取数据库连接字符串(如果连接字符串放在Web.config,然后在Global.asax初始化) 在Application_Start添加以下代码: Application["ConnStr"]=this.Context.Request.PhysicalApplicationPath+ConfigurationSettings.AppSettings["ConnStr"].ToString(); 31. 变量.ToString() 字符型转换 转为字符串 12345.ToString("n"); //生成 12,345.00 12345.ToString("C"); //生成 ¥12,345.00 12345.ToString("e"); //生成 1.234500e+004 12345.ToString("f4"); //生成 12345.0000 12345.ToString("x"); //生成 3039 (16进制) 12345.ToString("p"); //生成 1,234,500.00% 32、变量.Substring(参数1,参数2); 截取字串的一部分,参数1为左起始位数,参数2为截取几位。 如:string s1 = str.Substring(0,2); 34.在自己的网站上登陆其他网站:(如果你的页面是通过嵌套方式的话,因为一个页面只能有一个FORM,这时可以导向另外一个页面再提交登陆信息) <SCRIPT language="javascript"> <!--  function gook(pws)  {   frm.submit();  } //--> </SCRIPT> <body leftMargin="0" topMargin="0" onload="javascript:gook()" marginwidth="0" marginheight="0"> <form name="frm" action=" http://220.194.55.68:6080/login.php?retid=7259 " method="post"> <tr> <td> <input id="f_user" type="hidden" size="1" name="f_user" runat="server"> <input id="f_domain" type="hidden" size="1" name="f_domain" runat="server"> <input class="box" id="f_pass" type="hidden" size="1" name="pwshow" runat="server"> <INPUT id="lng" type="hidden" maxLength="20" size="1" value="5" name="lng"> <INPUT id="tem" type="hidden" size="1" value="2" name="tem"> </td> </tr> </form> 文本框的名称必须是你要登陆的网页上的名称,如果源码不行可以用vsniffer 看看。   下面是获取用户输入的登陆信息的代码: string name; name=Request.QueryString["EmailName"]; try {  int a=name.IndexOf("@",0,name.Length);  f_user.Value=name.Substring(0,a);  f_domain.Value=name.Substring(a+1,name.Length-(a+1));  f_pass.Value=Request.QueryString["Psw"]; } catch {  Script.Alert("错误的邮箱!");  Server.Transfer("index.aspx"); } 35.警告窗口 /**//// /// 服务器端弹出alert对话框 /// /// 提示信息,例子:"不能为空!" /// Page类 public void Alert(string str_Message,Page page) { page.RegisterStartupScript("","<script>alert('"+str_Message+"'); /// 服务器端弹出alert对话框,并使控件获得焦点 /// /// 获得焦点控件Id值,比如:txt_Name /// 提示信息,例子:"请输入您姓名!" /// Page类 public void Alert(string str_Ctl_Name,string str_Message,Page page) { page.RegisterStartupScript("","<script>alert('"+str_Message+"');document.forms(0)."+str_Ctl_Name+".focus(); document.forms(0)."+str_Ctl_Name+".select(); /// 服务器端弹出confirm对话框 /// /// 提示信息,例子:"您是否确认删除!" /// 隐藏Botton按钮Id值,比如:btn_Flow /// Page类 public void Confirm(string str_Message,string btn,Page page) { page.RegisterStartupScript("","<script> if (confirm('"+str_Message+"')==true){document.forms(0)."+btn+".click();} /// 服务器端弹出confirm对话框,询问用户准备转向那些操作,包括“确定”和“取消”时的操作 /// /// 提示信息,比如:"成功增加数据,单击\"确定\"按钮填写流程,单击\"取消\"修改数据" /// "确定"按钮id值 /// "取消"按钮id值 /// Page类 public void Confirm(string str_Message,string btn_Redirect_Flow,string btn_Redirect_Self,Page page) { page.RegisterStartupScript("","<script> if (confirm('"+str_Message+"')==true){document.forms(0)."+btn_Redirect_Flow+".click();}else{document.forms(0)."+btn_Redirect_Self+".click();} /// 使控件获得焦点 /// /// 获得焦点控件Id值,比如:txt_Name /// Page类 public void GetFocus(string str_Ctl_Name,Page page) { page.RegisterStartupScript("","<script>document.forms(0)."+str_Ctl_Name+".focus(); document.forms(0)."+str_Ctl_Name+".select(); ///名称:redirect ///功能:子窗体返回主窗体 ///参数:url ///返回值:空 /// public void redirect(string url,Page page) { if ( Session["IfDefault"]!=(object)"Default") { page.RegisterStartupScript("","<script>window.top.document.location.href='"+url+"';是否为数字 /**//// /// 名称:IsNumberic /// 功能:判断输入的是否是数字 /// 参数:string oText:源文本 /// 返回值: bool true:是 false:否 /// public bool IsNumberic(string oText) { try { int var1=Convert.ToInt32 (oText); return true; } catch { return false; } } 获得字符串实际长度(包括文字符) //获得字符串oString的实际长度 public int StringLength(string oString) { byte[] strArray=System.Text .Encoding.Default .GetBytes (oString); int res=strArray.Length ; return res; } 42.将回车转换为TAB //当在有keydown事件的控件上敲回车时,变为tab public void Tab(System.Web .UI.WebControls .WebControl webcontrol) { webcontrol.Attributes .Add ("onkeydown", "if(event.keyCode==13) event.keyCode=9"); } 43.datagrid分页如果删除时出现超出索引 public void jumppage(System.Web.UI.WebControls.DataGrid dg) { int int_PageLess; //定义页面跳转的页数 //如果当前页是最后一页 if(dg.CurrentPageIndex == dg.PageCount-1) { //如果就只有一页 if(dg.CurrentPageIndex == 0) { //删除后页面停在当前页 dg.CurrentPageIndex = dg.PageCount-1; } else { //如果最后一页只有一条记录 if((dg.Items.Count % dg.PageSize == 1) || dg.PageSize == 1) { //把最后一页最后一条记录删除后,页面应跳转到前一页 int_PageLess = 2; } else //如果最后一页的记录数大于1,那么在最后一页删除记录后仍然停在当前页 { int_PageLess = 1; } dg.CurrentPageIndex = dg.PageCount - int_PageLess; } } } 发表于 2
Web应用前端技术的探索与实践 1 1 前端开发那些事 1 2 怎样提高前端的质量和工作效率? 1 附件(关于2011年工作的一点浅见) 3 3 探讨一些技术问题 4 3.1 Frameset和iframe 4 3.2 Frameset和Div两种方式的对比 5 3.2.1 frameset布局的优点 5 3.2.2 frameset布局的缺点 5 3.2.3 DIV传统布局与frameset相比的优点 5 3.2.4 DIV传统布局与frameset相比的缺点与解决办法 6 3.2.5 大量使用ajax的DIV局部页面,会遇到的一些难点 6 3.2.6 解决方法 6 3.2.7 结论 6 3.3 基于DIV的网页布局-模版的核心 7 3.3.1 概述 7 3.3.2 简单、直观的DIV布局 7 3.3.3 DIV布局问题的终极解决方案 9 3.3.4 解决DIV被撑爆的问题 12 3.3.4.1 DIV撑爆的问题 12 3.3.4.2 图片撑爆问题的解决办法 13 3.3.4.3 文字撑爆问题的解决办法 13 3.4 Java Web应用的DIV布局 14 4 主流邮件系统前端开发的研究 19 4.1 21cn企业邮 19 4.2 Sohu邮箱 21 4.3 网易邮箱 30 4.4 腾讯网络邮箱(foxmail) 40 4.5 新浪邮箱 47 4.6 关于邮箱业务的题外话 49 4.7 小结 51 5 一些应用的问题 51 5.1 21cn.com 51 5.2 综合管理平台 51 5.2.1 文件组织 51 5.2.2 UI 53 5.2.3 Jsp文件胡乱包含 53 6 前端组件及其研发的探索和实践 54 6.1 用户、应用 55 6.2 网站和web应用公共组件的层次 55 6.3 Web应用前端组件的研发原则 56 6.4 研发流程 56 6.5 常用前端组件的分析和研究 57 6.5.1 概述 57 6.5.2 通用组件 58 6.5.2.1 Accordion 58 6.5.2.1.1 效果 59 6.5.2.1.2 参数说明 60 6.5.2.2 Tab 61 6.5.2.2.1 效果 61 6.5.2.2.2 参数说明 64 6.5.2.2.3 事件说明 64 6.5.2.2.4 方法说明 65 6.5.2.2.5 属性说明 65 6.5.2.3 封装Accordion和Tab为Switchable 65 6.5.2.3.1 使用JQuery Tools构建 67 6.5.2.3.2 JQuery Tools的Switchable对Ajax的支持 68 6.5.2.3.3 使用JQuery Switchable 70 6.5.2.3.4 使用kissy Switchable 78 6.5.2.4 统计分析图表组件 94 6.5.2.4.1 应用实例1 95 6.5.2.4.2 应用实例2 97 6.5.2.5 DataGrid1-浏览表格数据 102 6.5.2.5.1 效果 103 6.5.2.5.2 参数说明 107 6.5.2.6 DataGrid2-可编辑cell 110 6.5.2.6.1 效果 110 6.5.2.7 DataGrid3-控制列是否显示 113 6.5.2.7.1 效果 113 6.5.2.8 Tree 116 6.5.2.8.1 效果1 116 6.5.2.8.2 效果2 117 6.5.2.9 树表组件 121 6.5.2.9.1 TABLETREE4J 121 6.5.2.9.2 JQuery TreeGrid 124 6.5.2.10 Combo扩展1-去除IE6下穿透层的bug 129 6.5.2.10.1 效果 130 6.5.2.11 Combo扩展2-新样式、可多选 131 6.5.2.11.1 效果 131 6.5.2.12 Combo扩展3-ComboGrid 134 6.5.2.12.1 效果 134 6.5.2.13 Combo扩展4-ComboTree 137 6.5.2.13.1 效果 137 6.5.2.14 日期-时间选择 139 6.5.2.14.1 基于JQuery EasyUI的日期选择组件 139 6.5.2.14.2 My97DatePicker 142 6.5.2.15 TimeSpinner 146 6.5.2.15.1 效果 146 6.5.2.15.2 应用 147 6.5.2.16 NumberSpinner 148 6.5.2.16.1 效果 148 6.5.2.17 MenuButton 149 6.5.2.17.1 效果 149 6.5.2.18 分页组件Pagination 151 6.5.2.18.1 效果 151 6.5.2.18.2 参数说明 152 6.5.2.19 文件上传组件 153 6.5.2.19.1 uploadify 153 6.5.2.19.2 swfUpload 159 6.5.2.20 消息提示、弹出广告组件 162 6.5.2.20.1 效果 162 6.5.2.20.2 方法说明 165 6.5.2.20.3 扩展说明 166 6.5.2.21 Panel组件 166 6.5.2.21.1 效果 166 6.5.2.21.2 参数说明 168 6.5.2.21.3 事件说明 169 6.5.2.21.4 方法说明 170 6.5.2.22 Window组件 170 6.5.2.22.1 效果 170 6.5.2.22.2 使用说明 172 6.5.2.23 Form数据验证 173 6.5.2.23.1 效果 173 6.5.2.24 内容自动完成、Suggest 174 6.5.2.24.1 效果 175 6.5.2.24.2 应用说明 176 6.5.2.25 WYSIWYG在线Html内容编辑器 179 6.5.2.25.1 SinaEditor 179 6.5.2.25.2 CKEditor 181 6.5.2.26 JMesa 184 6.5.2.26.1 效果 185 6.5.2.26.2 一个较为复杂的应用实例 185 6.5.3 综合实例 191 6.5.3.1 Portal 191 6.5.4 展望 195 7 前端页面的优化工作概论 195 7.1 前端页面优化的策略 196 7.2 网站加速的主要方法 198 7.2.1 Web层 198 7.2.2 应用层 203 8 总结 205

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧