13 בנובמבר 2009
I was looking for a tool to compress js+css files that i can integrate into project post build event or MSBUILD.One of the popular tools is Yui, It works fine but requieres installed JVM on DEV machine and it's not simple to write a wrapper for it.I tried also the JSMin, It does the job but works for js files only. The best solution that I found is the .NET version of Yahoo.Yui.Compressor.I integrated the assembly into a console app. and wrote a method that:1. Gets the js scripts + css folder names as parameters.2. Finds all files that contains...
6 במרץ 2009
I would like to share with You my ASP.NET MVC Error Handling solution after reading this question in stackoverflow.com Goal:To catch every error that occures on server include HttpExeptions like 404 (Page not found).The ability to choose a specific View (error Template) for some errors and a generic View/Behaviour if nor specific has been specified.Scenario 1: anonymus user typed a wrong url.Actions:display a user friendly message like: "OOPS, The page is missing... back to home"Log the error to .log file on server.Send email to admin.Senario 2: same as scenario 1 but one difference : user is anonymus but his IP...
28 בינואר 2009
A new version of MVC Framework is just released and has some cool improvements: The Views have no ".cs" (code behind like) files.You could generate CRUD Views from VS.HTML Form fields could be Type Safe, You could Bind class property to form field. The Controller action behavior is very testability, example:The Moq example from ScottGu's post:
public void Display_Message_Authenticated()
HomeController controller = new HomeController();
Mock<ControllerContext> mockControllerContext = new Mock<ControllerContext>();
mockControllerContext.Setup(c => c.HttpContext.Request.IsAuthenticated).Returns(true);
mockControllerContext.Setup(c => c.HttpContext.User.Identity.Name).Returns("test");
controller.ControllerContext = mockControllerContext.Object;
ViewResult result = controller.DisplayMessage() as ViewResult;
14 בינואר 2009
Hi, There's a new release of Typemock Isolator 5 This tool is excellent and helps to improve your unit tests. Programming Visual Basic applications? Typemock have released a new version of their unit testing tool, Typemock Isolator 5.2.This version includes a new friendly VB.NET API which makes Isolator the best Isolation tool for unit testing A Visual Basic (VB) .NET application.Isolator now allows unit testing in VB or C# for many ‘hard to test’ technologies such as SharePoint, ASP.NET MVC, partial support for Silverlight, WPF, LINQ, WF, Entity Framework, WCF unit testing and more. Note that the first 25 bloggers...
5 בדצמבר 2008
One of the most important performance improvements issues on Web Applications is caching AJAX calls on client browser. Faster page responses improve the client UI as well.Since I read about this little hack of omar zabir that fixes a known .net framework Cache-Control header setting bug I implement this solution on every project.For Web Application I keep on using MVC Framework beta so a very elegant to implement ajax responses caching by creating a custom ActionFilterAttribute class.Important: You can put in client side cache only Ajax "GET" requests. the Code:
30 בספטמבר 2008
I used to work with the IoC libraries Unity Application Block, StructureMap which I found very good but I wanted a very basic one that keeps the services/repositories as singleton, no need to manage state/lifetime of objects..I didn't use one of the libraries I mentioned above because I don't need most of their functionallity. So... I wrote my basic IoC and would like to share it with You:
Step 1 - App.Config/Web.config
<!--Add this line inside "configSections" -->
<section name="ioc" type="Framework.IoC.MappingSectionHandler, Framework.IoC, Version=22.214.171.124, Culture=neutral, PublicKeyToken=ce99303d14144e28"/>
</configSections> Step 2 - Add object mapping table
add your mapping table after end of </configSections>:
3 באוגוסט 2008
Script Benefits (or Why do you need such a script...?):
1. If you use this script, You don't need to use ScriptManager or any form runat="server" in order to consume a Web/WCF Service. The unnesesery viewstate increase your page.
2. You can call a Web/WCF Service from any static HTML file.
3. Very light script (1.4 k) , the ScripyManager generated output scripts are much larger.
4. The must be some more good reasons to use it ( but it late and I'm tired).
I attached the Ajaxlib.js as attachment for download.
Here are 2 "real world" examples of the script usage:...