随笔分类 -  ASP.Net and MVC

摘要:1. iframe自适应高度?2. 如何获得屏幕分辨率?3. GridView如何增加过滤器filter?4. 如何将GridView中的数据保存到Excel中?5. TextBox如何只接受数字?6. GridView如何嵌套另外的GridView?7. asp.net如何检测来自手机浏览器的请求?8. 如何实现程序下载自动更新?最后更新时间:2011-7-30长期更新中... 阅读全文
posted @ 2011-04-24 17:35 qiang.xu 阅读(468) 评论(0) 推荐(0) 编辑
摘要:今天下载壁纸时发现这样一个比较人性化的设置:那么这里是如何检测到“电脑的分辨率”的?下面是一个简单的解决方法,但是存在缺陷。<script language="javascript">var width = screen.width;var height = screen.height;if( width < 1280 || height < 1024){ alert("This web page is best viewed with a screen resolution of 1280 by 1024 or higher. Your 阅读全文
posted @ 2011-03-19 19:49 qiang.xu 阅读(4573) 评论(0) 推荐(1) 编辑
摘要:1.How Internet Explorer was born?微软公司在1995年退出了自己的第一款浏览器,命名叫“Internet Explorer” ,但实际上这款浏览器是SpyGlass公司研发生产的,194年SpyGlass公司将研发的浏览器source授权给ms公司,于是有了95年的ie的第一个版本。看看这款浏览器吧,今天看上去是如此ugly,无法想象当时的人们对此居然津津乐道。2.Internet Explorer 2ie2是第一款跨平台的浏览器,能够同时支持windows和macos。3.Internet Explorer 34.Internet Explorer 4(Win 阅读全文
posted @ 2011-03-13 17:47 qiang.xu 阅读(383) 评论(0) 推荐(0) 编辑
摘要:1. 情景描述2. 测试代码1. 情景描述首先使用asp.net中自带空间FileUpload将图片上传到服务器上之后,在&ldquo;在线编辑器&rdquo;中需要显示该图片,需要得到该图片的以http://开头的url路径2. 测试代码其实只需要使用System.Web.UI.Control.ResolveUrl (string),其中string参数是上传图片的相对路径。 阅读全文
posted @ 2011-02-13 19:34 qiang.xu 阅读(2176) 评论(0) 推荐(0) 编辑
摘要:1.iframe自适应高度?2. 上传图片并保存到服务器上之后,如何得到该图片服务器路径(http://...) 更新中... 阅读全文
posted @ 2011-02-13 10:58 qiang.xu 阅读(198) 评论(0) 推荐(0) 编辑
摘要:当你在安装了.NET Framework 4.0以上版本后,当你的应用程序以.NET Framework 4.0为框架版本,你的任意服务器请求,都将被进行服务器请求验证(ValidationRequest),这不仅包括ASP.NET,同时也包括Web Services等各种HTTP请求,不仅仅针对aspx页面,也针对HTTP Handler,HTTP Module等,因为这个验证(Valify)的过程,将会发生在BeginRequest事件之前。 问题的解决方案就是在全局级别(Web.config中)设置&lt;configuration&gt;&lt;system.w 阅读全文
posted @ 2011-02-06 02:09 qiang.xu 阅读(307) 评论(0) 推荐(0) 编辑
摘要:By default, FileUpload control will not work inside an UpdatePanel control for uploading files using Asynchronous postback. This is because, the file uploading and file manipulations is restricted by default in client side for security reasons. Hence it is not possible to upload files using asynchro 阅读全文
posted @ 2011-02-04 01:44 qiang.xu 阅读(708) 评论(0) 推荐(0) 编辑
摘要:Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid itIf you've used theMicrosoft ASP.NET AJAXUpdatePanelcontrol, there's a good chance you've hit the "Sys.WebForms.PageRequestManagerParserErrorException" error.What's a PageRequestManagerParser 阅读全文
posted @ 2011-02-03 23:46 qiang.xu 阅读(423) 评论(0) 推荐(0) 编辑
摘要:1. 如何生成网页略缩图?2. 如何实现登陆页面(包含生成验证码和如何避免sql注入)?长期更新... 阅读全文
posted @ 2011-02-03 22:01 qiang.xu 阅读(283) 评论(0) 推荐(0) 编辑
摘要:1. 关键代码:usingSystem;usingSystem.Drawing;usingSystem.Windows.Forms;usingSystem.Threading;usingSystem.IO;usingSystem.Reflection;namespaceWebsiteThumbnail{publicclassWebsiteThumbnailImageGenerator{publicstaticBitmapGetWebSiteThumbnail(stringUrl,intBrowserWidth,intBrowserHeight,intThumbnailWidth,intThum 阅读全文
posted @ 2011-02-03 21:58 qiang.xu 阅读(647) 评论(0) 推荐(0) 编辑
摘要:个人代码管理工具V1.0:下载地址:http://cid-f41b44b9285d0b86.office.live.com/self.aspx/%E5%85%AC%E5%BC%80%E6%96%87%E4%BB%B6%E5%A4%B9/ASP.Net%E5%85%AC%E5%BC%80%E9%A1%B9%E7%9B%AE/MyCodeLibrary.rar 阅读全文
posted @ 2010-12-25 11:17 qiang.xu 阅读(603) 评论(0) 推荐(0) 编辑
摘要:未能加载&ldquo;程序名.Global&rdquo;类型,这种错误出现的主要原因是项目中存在错误,修改项目中错误,然后该错误消失。 阅读全文
posted @ 2010-12-22 17:57 qiang.xu 阅读(206) 评论(0) 推荐(0) 编辑
摘要:1.为什么需要产生viewstate概念?2.使用demo了解asp.net page的life cycle,进而了解viewstate工作原理?1.为什么需要产生viewstate概念?当 classic ASP 中的表单被提交时,所有的表单值都会被清空。设想一下,您提交了一张带有大量信息的表单,而服务器返回了一个错误。您将不得不返回表单,然后更正其中的信息。您点击后退按钮,然后会发生什么呢... 所有的表单值都被清空了,而您将不得不重新开始所有的一切。站点不会维持您的 ViewState。当 ASP .NET 中的表单被提交时,表单会随所有表单值一同重新出现。如何做到的呢?这是由于 ASP 阅读全文
posted @ 2010-12-20 17:15 qiang.xu 阅读(293) 评论(0) 推荐(0) 编辑
摘要:asp.ne bbst源码分析1.登陆页面1.登陆页面登陆页面中需要注意的大致上就是两条:如何实现验证码?如何防止sql注入。1.如何实现验证码?验证码简单的实现可以通过在服务器端生成一个图片完成。前台的话添加一个img html控件,onclick事件中重新加载checkcode页面。后台中使用dotnet类库中自带的drawing来实现生成一个图片。代码即文档,代码如下:&lt;img id="Img1" alt="看不清,请点击我!" onclick="this.src=this.src+'?'" src 阅读全文
posted @ 2010-12-16 18:55 qiang.xu 阅读(728) 评论(0) 推荐(0) 编辑
摘要:asp.net 头像上传裁剪模块1.界面演示2.代码下载地址1.界面演示2.代码下载地址http://xuqianghit.download.csdn.net/ 阅读全文
posted @ 2010-12-13 11:04 qiang.xu 阅读(931) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2010-12-06 21:56 qiang.xu 阅读(215) 评论(0) 推荐(0) 编辑
摘要:asp.net发布web service时出现&ldquo;未能创建类型&rdquo;错误如果直接将web service发布之后,如果不转换成&ldquo;应用程序&rdquo;的话,将产生&ldquo;未能穿件类型&rdquo;的错误与。解决的方法: 阅读全文
posted @ 2010-11-29 16:01 qiang.xu 阅读(676) 评论(0) 推荐(0) 编辑
摘要:1.如何向页面中传递参数? public ActionResult Index(string id, Nullable&lt;int&gt; other) { this.ViewData["Other"] = other; return View(); } 上面中的id变量是在index页面初始化的时候,通过mvc framework来实现传递的(http://...?id=1)。2.如何制定form的action函数? &lt;form action="ShowPostData" method="post"& 阅读全文
posted @ 2010-09-08 14:58 qiang.xu 阅读(864) 评论(0) 推荐(0) 编辑
摘要:1.The Controller Action public ActionResult Index() { ViewData["Message"] = "Welcome to ASP.NET MVC!"; return View(); } An action method normally returns an ActionResult and can take zero or many arguments.一个action方法通常情况下返回ActionResult,能够带0个或者多个参数。If the view name matches the act 阅读全文
posted @ 2010-09-01 19:10 qiang.xu 阅读(258) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示