DCSIMG
Dev - Pini Dayan

Pini Dayan

The best thing about a boolean is even if you are wrong, you are only off by a bit.

Browse by Tags

All Tags » Dev (RSS)
JavaScript Callee property
Hi all, It always amazes me how I discover another JavaScript feature I wasn’t aware of. The feature I want to discuss here in this post is the Callee property we have from the arguments property we have when we are in a function scope. This property will return the current function being executed right now. In addition we have the caller property that we can use to get a reference to the calling function.Imagine you could even do crazy stuff like getting the caller function and its argument by doing...
How to easily search SQL stored procedures and objects
Hi all, Lately I have been working on a Migration project in which I had to move data from an old SQL DB into a new one with a different schema (slightly different). In order to understand the differences I downloaded several free tool in which I could compare both schema. There are lots of good tool for that but during the project I also had to look out for things like: 1. Which stored procedures and Tables FK uses a given column? 2. Which tables contains a given ID and much much more questions...
Posted: Oct 26 2010, 09:57 AM by Pini Dayan | with 2 comment(s)
תגים:,
ASP.NET Ajax 4/3.5 CDN support
Today I found out a cool nice thing. As we all know Microsoft ASP.NET Ajax 4.0 is shipped with the new caching support for the JS library it uses. This feature is called the CDN and basically it is working and increasing performance by spreading lots of servers around the world that store JS files like the ASP.NET Ajax 4.0 and the Jquery library files. From Microsoft: “By taking advantage of the Microsoft Ajax CDN, you can significantly improve the performance of your Ajax applications. The contents...
Adding/Firing custom event using JavaScript
Today I found out a very cool way for adding custom events and fire them for any Client side object. This can be done using ASP.NET Ajax very easily. (Thank you Igor). In order to create these events and fire them we will use the Sys.EventHandlerList Class . This class Creates a dictionary of client events for a component, with event names as keys and the associated handlers as values. It’s main method we need are the addHandler and getHandler. Lets see a simple example which is pretty self explanatory...
Ever forgot “alert()” when deployed to production
As developers we often forget to remove debug code on the client side such as “alert” calls , “debugger” statements and so on. So in order to avoid our team leader throw a chair at us here is a simple solution to this problem: On the page startup ( page load or when ever you find it necessary) simply override the alert method like this: Set alert to work only in debug var originalAler = window.alert; window.alert = function (message) { if (Sys.Debug.isDebug) {    originalAler(message);...
Using C# 4 to implement lazy initialization
Sometimes we wish to improve performance and improve memory usage by making sure the Object we create and initialize is really needed. A couple of scenarios that we might thing of are: We have an object that is expensive to create and there might be situations when we don't really need it. Lets say we have an Employee object in memory and this Employee has a property by the name FormerEmployers that describe all the places he worked at. This information is initialized from a DB. If the consumer...
Posted: Apr 08 2010, 10:02 AM by Pini Dayan | with 2 comment(s)
תגים:,
ASP.NET 4.0 New features – HTML, JS, ASP.NET Snippets
In previous version of VS.NET we encountered the new snippet solution for creating a chunk of code that is usually reusable and then using it during programming or even lecturing. This feature was available for both C# and VB.NET coders. But we could not create or use snippets for the markup we are writing like HTML, JavaScript or even the ASP.NET page. VS.NET 2010 allows us to do just that! Lets see some of the “out of the box” snippets we can use: HTML Snippets: AS you can see the same snippet...
ASP.NET 4.0 New features – URL Routing
Hi all, In this series of posts I am going to write about ASP.NET 4.0 new features. I will try to concentrate on the important features since there are many new cool ones. At this point of writing I am using the VS.NET 2010 Ultimate Beta 2 version. So lets introduce the first feature: URL Routing: URL Routing is the ability to use “friendly” URL’s instead of of using the once we know so far. So instead of using the knows URL’s like: http://www3.cet.ac.il/FieldsPage.aspx?ID=Science http://www.google...
Ajax ToolKit:Fix ResizableControl handler position problem
One of the controls available in the Ajax ToolKit is the ResizableControlExtender which makes a panel (div) resizable. One of the major bugs this control has his the ability to set the location for the handler (The place holder for the mouse with the resize cursor) to the left bottom corner of the ResizableControl target. There are many solutions out there , but as I tried them most of them simply do not solve the problem. After downloading the ResizableControlBehavior.js file and learning how it...
Ajax Tip: Set position for ModalPopupExtender
Hi all, Ever wanted to set the location of the Modal windows you open using the ModalPopupExtender available when using ASP.NET Ajax toolkit? Well there is a very simple way to do it using BLOCKED SCRIPT 1. Get the position you want the modal window to show. You can do it using ASP.NET Ajax library using Sys.UI.DomElement.getLocation method like this: var location = Sys.UI.DomElement.getLocation($get( "div1" )); In this case I used some div control to set the modal windows next to it. 2...
Microsoft ASP.NET Ajax DOM Events
Hi all, Lately I add to deal with a lot of cross browser stuff (Needless to say is is very ugly and in frustration times I wish we only had IE :-) ) Anyway , one cool way to solve lots of these issues is of course to use a Framework that does all the Cross browser JS for you.I am using Microsoft ASP.NET Ajax Library. Here is a nice example of how to handle mouse clicks in a way that will work on IE, Chrome and Firefox. When trying to work with the mouse event (And writing cross browser code) you...
RoundedCorners control – how does it really work?
ASP.NET Ajax toolkit has many cool controls, one of them is the RoundedCorners control. I think any ASP.NET developer meets the problem of how to create a control with rounded corners sometime during his career. Most of us solve this issue using images by creating 4 images , one for each corner. Here is a good example of how to achieve this using image and table. There is another solution that is not yet cross browser one. there is the css 3 new upcoming feature for giving each control a raduis....
ASP:Chart control – Amazing
Today I discovered something I should have known long ago. ASP.NET has a Chart control!!! It is free to download and use and it will be part of ASP.NET 4.0 coming up soon. If you wish to use it today simply follow these steps: 1. Download and install the  Chart controls . 2. Download and install the VS 2008 tool support . 3. Optional: Download the code samples . This is a huge web application project we can learn a lot from. Here are some snap shots of what you can do with these control I took...
Building ASP.NET Real – time web application – Part 5
After seeing the core of the real-time solution in post 1 – 4 this post will show the other code parts and specify a few details and steps we can take to optimize the solution: So here are the missing codes to complete the puzzle: The StocksValuesDB class, that simulate a DB being updated in each interval and has an event to tell clients when an update occurs: public class StocksValuesDB { //The event this DB raised when the data changes public delegate void StocksChangedDeleaget ( StocksEventArgs...
Building ASP.NET Real – time web application – Part 4
In the previous post, I explained how to use the HTTP Async handler (or simply Async page) in order to create a callback and store it somewhere. Later when something changes this callback will be invoked and update the web client waiting for update. But what is this callback ,how do we get it invoked and what is BeinXXX and EndXXX in this post: Asynchronous Programming Model: When an application performs an IO operation, the application is very much depend on the device that is doing this IO work...
More Posts Next page »