惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
爱范儿
爱范儿
P
Proofpoint News Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
J
Java Code Geeks
宝玉的分享
宝玉的分享
Jina AI
Jina AI
B
Blog
N
Netflix TechBlog - Medium
Recent Announcements
Recent Announcements
aimingoo的专栏
aimingoo的专栏
腾讯CDC
C
Check Point Blog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky
罗磊的独立博客
B
Blog RSS Feed
WordPress大学
WordPress大学
小众软件
小众软件
博客园 - 叶小钗
M
MIT News - Artificial intelligence
GbyAI
GbyAI

博客园 - Gordon Golden Shining

who am I inside of me STGenerator Released ObjectDataSource的Add-In Asp.net page lifecycle explain in msdn 我做的代码生成的工具的思路 (支持.NET2.0) Programming Haskell in Visual Studio.net 2003 C#/VB.Net converter A good book to read A possible way for testing threading/server application a break in .net 2.0 remoting WinXP sp2 and win 2003 does break com+/System.Transaction 2.0 You have to read this All about codes generation New tools box for year 2005 Recommend: IOC container must read article dynamic proxy how to How to implement AOP in .net My Wishlist for .net development No refresh dropdownlist using xmlhttp callback
some common used tips in web development
Gordon Golden Shining · 2005-07-13 · via 博客园 - Gordon Golden Shining

Been working on the post-production phase in a web project recently, and some features can be really nice to have..

1. Prevent duplication form post when you insert a new record.
http://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=98

<SCRIPT language=JavaScript > 
                    var submitcount=0;   
                   function checkSubmit()
                   {     
                    if (submitcount == 0)
                       { submitcount++; return true; }  
                    else
                       { alert('This form has already been submitted.' ); return false; } 
                    } 
</SCRIPT>

<form name=frmSubmit method=post onSubmit=" return checkSubmit();" action="mypage.asp" >

2. A simple progress bar to wait the next page...
http://blogs.crsw.com/mark/articles/642.aspx
http://blogs.crsw.com/mark/samples/BusyBoxDemo/Default.aspx

 All that is need for this page is:
- a single line of code to reference the busy box javascript.
- a small javascript statement in the body tag's onbeforeunload event.
- a small iframe tag.
- a single line of code to instantiate our busy box object.
- a BusyBox.htm file to reference (or any name you like).

3. Open IIS6 compression to make asp.net faster
you need to manually modify the iis6 config file, just following through the links
http://www.dotnetdevs.com/articles/IIS6compression.aspx
http://support.microsoft.com/?id=322603

4. Make the block collapsable
example is in a custom control format

//this is the javascript function to be emitted.
  private string getJsScript()
  {
   StringBuilder sb = new StringBuilder();
   sb.Append("<script>\n");
   sb.Append("function collapse(id){\n");
   sb.Append("var ul = document.getElementById(id);\n");
   sb.Append("ul.style.display = (ul.style.display == \"block\") ? \"none\" : \"block\";\n");
   sb.Append("}\n");
   sb.Append("</script>");

   return sb.ToString();
  }

//release the javascrip
  protected override void OnPreRender(EventArgs e)
  {
   Page.RegisterClientScriptBlock("collapseScript", getJsScript());
   base.OnPreRender(e);
  }

//in the create control function add the javascript function call when click
  protected override void Render(HtmlTextWriter writer)
  {   
     this.EnsureChildControls();
     string ulId = "leftmenusep";

     writer.AddAttribute("src", CollapseIconLocation);
     writer.AddAttribute("onclick", String.Format("javascript:collapse('{0}');", ulId));
     writer.RenderBeginTag("img");
     writer.RenderEndTag();
}