
ASP.NET
jameszhouhvs
WinForm > ASP.NET > MVC > Silverlight > WP > Xamarin > .NET Core > .NET
展开
-
ASP.NET - 动态用户控件,ViewState及事件
由于Web的"无状态"本质,ASP.NET (Web Forms)项目动态加载用户控件需要注意一些问题:1. 在页面的每次Postback,都要重新创建动态加载的用户控件可将动态控件的路径,存放在页面的ViewState中,并在每次Postback,根据ViewState中存放的路径重新加载该控件。一种实现方式是重写页面的LoadViewState方法,在其中重新加载动态控件: protected原创 2013-09-10 12:24:57 · 2873 阅读 · 0 评论 -
ASP.NET MVC - Display UTC time from server as local time on client side
View html:span class="utcdatetime">@user.MostRecentTestDate.Value.ToString("M/dd/yyyy hh:mm tt UTC")span>View js:(needs reference to jquery.formatDateTime.js from https://github.com/agschwender/jquery原创 2015-11-11 21:01:59 · 1754 阅读 · 0 评论 -
asp.net MVC: PagedList + View Model
To pass view model with PagedList:1. Controller action must use HttpGet and use View Model as action parameterpublic ActionResult Index(UserIndexModel model)2. In the action return the view model with原创 2015-11-10 19:18:07 · 2286 阅读 · 0 评论 -
LINK - JS: 使用event.preventDefault 阻止表单控件默认提交的行为
link - http://api.jquery.com/event.preventDefault/原创 2014-12-19 19:22:03 · 2182 阅读 · 0 评论 -
button's UseSubmitBehavior="true" and RichText control (TelerikEditor or DevExpress Editor)
Problem: on post back the value of richtext's Html always lose the changes user edited in the UISolution: set UseSubmitBehavior="true" on the button to submit.reference: http://www.telerik.com/support原创 2014-02-14 12:22:16 · 1379 阅读 · 0 评论 -
UI issue only occurs in IE
We have a page UI working unexpected in IE which is missing style of float and position. Other browsers are fine. With IE developer tool (F12), I see a information in the console saying that "the atta原创 2014-02-25 14:02:47 · 1899 阅读 · 0 评论 -
asp.net MVC plugin 问题 1
asp.net mvc 项目需要实现plugin功能:参考方案 http://blog.longle.net/2012/03/29/building-a-composite-mvc3-application-with-pluggable-areas/问题: plugin安装后,必须重启整个host应用,才能使得plugin生效。 a 通过修改web.config的方式发现,plugin d原创 2014-01-15 15:14:08 · 1501 阅读 · 0 评论 -
ASP.NET 页面错误: "asp.net XML Parsing Error: no element found Line Number 1, Column 1"
Asp.net程序启动页面在IE,Google下白屏,在firefox下有如下错误: "asp.net XML Parsing Error: no element found Line Number 1, Column 1"可以通过Global.asax 的Appliaction_Error断点查看错误:Exception error = Server.GetLastError();本例错误原因是原创 2013-12-05 10:16:30 · 3266 阅读 · 0 评论 -
Telerik ASP.NET Ajax RadGrid - 如何实现双击行触发ItemCommand
telerik:RadGrid runat="server" ID="listGrid" GridLines="None" AutoGenerateColumns="false" Width="100%" AllowFilteringByColumn="true" AllowSorting="true" AllowPaging="true" Al原创 2013-11-07 15:54:17 · 3063 阅读 · 0 评论 -
Tip - 如何解决ASP.NET RadEditor 没有将Content post back
in Version 2013.2.717.45 IE10 not working but Chrome worksHow to fix: http://www.telerik.com/support/kb/aspnet-ajax/editor/radeditor-content-not-saved-after-ajax-update-in-ie9-firefox-google-chrome-an原创 2013-11-06 17:31:28 · 1399 阅读 · 0 评论 -
ASP.NET MVC - Windows集成验证问题
ASP.NET 4.0 问题: 启用Windows Auth,页面请求总是跳转到一个Login.aspx页面解决:在web.config中添加以下配置到appSettings中 add key="autoFormsAuthentication" value="false" /> add key="enableSimpleMembership" value="false"/>参考:http:原创 2013-11-19 22:53:05 · 3722 阅读 · 0 评论 -
System.Data - System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the r
项目环境:ASP.NET 4.5 + Entity Framework开发机上一切正常,部署到服务器Win2008 则遇到System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types异常堆栈信息显示是System.Data部分抛出异常,类似问题如:http://con原创 2013-11-17 01:58:59 · 4860 阅读 · 0 评论 -
IIS - css, images下载到客户端都是空文件问题
检查Windows Features是否还没启用 "静态内容" Internet Information Services > WWW Services > Common HTTP Features > Static Content参考:http://serverfault.com/questions/115099/iis-content-length-0-for-css-javascript-a原创 2013-11-15 15:23:16 · 1698 阅读 · 0 评论 -
ASP.NET AJAX 异常处理及在客户端显示用户用好的错误信息
项目使用了Telerik Ajax控件,由于Telerik Ajax基于MS AJAX并在异常处理方面与MS Ajax 保持一致 http://www.telerik.com/help/aspnet-ajax/ajax-error-handling.html方案:服务器端:在Application_Error中,把错误信息写入日志,但是并不通过Server.Transfer跳转到某个错误显示页面,原创 2013-10-28 12:01:39 · 1853 阅读 · 0 评论 -
ASP.NET MVC - loop model data in javascript
Key: razor syntax using @: before the js variable in c# code blockExample: var chartData = []; @for(int i=0; i < Model.ModuleDetails.Count; i++) { @: chartData.push(@Html.原创 2015-11-20 20:23:22 · 1751 阅读 · 0 评论