最近遇到的琐碎的问题asp.net
2011-02-09 18:08
197 查看
1, 在按钮的 OnClientClick 写js来确保用户做了要求的事,否则onclick事件不被触发,和使用验证控件一样。
2, Response.End不能写在try{}块中。
可以参考 http://support.microsoft.com/kb/312629/EN-US/
For Response.End, call the HttpContext.Current.ApplicationInstance.CompleteRequest method instead of Response.End to bypass the code execution to the Application_EndRequest event.
或者想其他办法写的try块外面。
3, base-64通过 abc.aspx?a=base-64字符。这样传参时会被转义,所以需要Server.UrlEncode()
29SpzbZPvSjxC7R5JmaifB1xrJ+ghbQV //base-64
29SpzbZPvSjxC7R5JmaifB1xrJ ghbQV //直接传过来的
29SpzbZPvSjxC7R5JmaifB1xrJ%2bghbQV //使用Server.UrlEncode()
The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", the lowercase characters "a" to "z", the numerals "0" to "9", and the symbols "+" and "/". The valueless character, "=", is used for trailing padding
4, Use varchar(max), nvarchar(max), and varbinary(max) data types instead of text, ntext, and image data types.
5,火狐和IE的缓存不一样,按后退按钮返回后保存的页面状态也不一样。
在page_load里添加 Response.Cache.SetNoStore(); 来解决。
<asp:Button runat="server" ID="Button1" Text="Postback" OnClientClick="if(!myFunc()) return false;"/>
<mce:script type="text/javascript"><!-- function myFunc() { if() { return false; } return ture; } // --></mce:script>
2, Response.End不能写在try{}块中。
可以参考 http://support.microsoft.com/kb/312629/EN-US/
For Response.End, call the HttpContext.Current.ApplicationInstance.CompleteRequest method instead of Response.End to bypass the code execution to the Application_EndRequest event.
或者想其他办法写的try块外面。
3, base-64通过 abc.aspx?a=base-64字符。这样传参时会被转义,所以需要Server.UrlEncode()
29SpzbZPvSjxC7R5JmaifB1xrJ+ghbQV //base-64
29SpzbZPvSjxC7R5JmaifB1xrJ ghbQV //直接传过来的
29SpzbZPvSjxC7R5JmaifB1xrJ%2bghbQV //使用Server.UrlEncode()
The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", the lowercase characters "a" to "z", the numerals "0" to "9", and the symbols "+" and "/". The valueless character, "=", is used for trailing padding
4, Use varchar(max), nvarchar(max), and varbinary(max) data types instead of text, ntext, and image data types.
5,火狐和IE的缓存不一样,按后退按钮返回后保存的页面状态也不一样。
在page_load里添加 Response.Cache.SetNoStore(); 来解决。
相关文章推荐
- ASP.NET 最近WEB开发遇到的小问题
- 最近我遇到的一些关于asp.net开发中的问题。。
- 最近遇到一个问题,怎么修改环境网站访问总会报ASP.NET 4.0错
- 最近在做ASP.net网站用到的技术和遇到的问题做个记录
- asp.net在iis种部署遇到的问题
- ASP.NET\ASP.NET MVC表单提交遇到的问题结论
- 【转】https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题
- 抛开visual studio,纯手工创建asp.net mvc遇到的问题
- ASP.net程序部署到另一个服务器中遇到的的问题
- ASP.NET开发遇到的权限问题
- asp.net 在DNN模块开发中遇到的resx怪问题
- ASP.NET用参数更新Access遇到的怪问题
- args.get_error的详细解释和在asp.net ajax中调用webservice遇到的问题
- 解决ASP.NET平台时遇到的“访问IIS元数据库失败问题
- 在 IIS6 ASP.NET 4.0 安装 最常遇到的四个问题
- ASP.NET 4.0中使用FreeTextBox和FCKeditor遇到安全问题警告的解决办法
- 利用fis3自动化处理asp.net项目静态资源时遇到的一个编码问题
- 今天学习“Asp.net"页面加载中"效果实现”遇到的问题
- [Asp.net4.0]在 IIS6 ASP.NET 4.0 安装 最常遇到的四个问题
- ASP.NET 4.0中使用FreeTextBox和FCKeditor遇到安全问题警告的解决办法