DCSIMG
ASP.NET - 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 » ASP.NET (RSS)
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);...
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...
Building ASP.NET Real – time web application – Part 3
In part 2 of these series of posts , I showed the basics of building the UI for the page and the JavaScript for calling the server using AJAX and waiting for a response. But how did I make the HTTP request “wait” and let the server “wake” it up? The answer is very simple. Async page (or Async HTTP Handlers). Here is a simple explanation from MSDN: “When ASP.NET receives a request for a page, it grabs a thread from a thread pool and assigns that request to the thread. A normal, or synchronous, page...
Building ASP.NET Real – time web application – Part 2
In the previous post , I wrote the general steps to accomplish the solution of achieving real time web application. In this post we will start and demonstrate the solution step by step and explain the application blocks of the solution from building the simple UI for this sample project and moving forward to the hardcode parts of the solution, so without further ado lets start. The demo code can be downloaded from here . (It is a web application solution that runs and works without a DB, but instead...
Building ASP.NET Real – time web application
What if we could write a web application that it’s clients (browsers in our case) can get notified in case of something happening in the server, like a DB row added/changed, a BL entity (from any object model you have built ) raising an event or anything you can come up with in your mind. To clarify things let me further explain by using a very simple example : Say you have a web page (aspx, html, or any other) that displays a various stocks values in a grid, these values are changing very fast and...
More Posts Next page »