Tag | Javascript Posts

I am using the mouse with my left hand but I am not swapping the mouse buttons. (Old habit from the times I was using public workstations at the university. I was too lazy to play with the system setup every time, so that I just moved the mouse from the right to the left side.) I am also using multiple pointing devices with my notebook. (a gaming mouse with multiple buttons at home, a simpler one at work, and also from time to time the touchpad ). Normally I would setup the mouse button layout in ...
My last project had me do some SharePoint 2010 Ribbon customizations. I though I would blog about some of the things I learned! There are many ways to create a Ribbon component. You could use a custom action to a tab to an existing Ribbon or in the case that I will be discussing/demonstrating is creating a complete new tab for a SharePoint Application page. The steps developer should take : Work through the Hand-On Lab provided by Microsoft on Customizing the Ribbon. This is part of The SharePoint ...
I’m working on a javascript learning tool, based on the edgecase koans for ruby. The idea is to express a set of javascript lessons as failing tests. By completing the koans in order the power and beauty of the language is slowly revealed without overwhelming complexity or a high concept count. I am planning to cover the following topics: about asserts Introduces the basic test framework used for the rest of the koans. about equality A quick look at the concept of equality in javascript. about truthyness ...
In my previous post on this particular topic, I had mentioned a problem I was having when attempting to post with a new application. I did discover that not all applications are created equal. When I created a second application specifically for this post, it would not work at all. I have not yet contacted Facebook support to determine the root cause. If you run into the issue where it appears that the application is being granted the proper permissions, but still cannot post, create another application ...
Update: I have now placed the zip containing the source for the end result of part 1 and 2 of this service template here. I decided to write a pair of posts on making it easier to create Windows Services in C# (and in .NET in general). This is the first post that talks about how to make a Windows Service debuggable (the default visual studio template does not allow the service to be easily debugged), and then next week’s post will discuss making the Windows Service self-installing. Now, these posts ...
One of the main reasons this blog hasn’t gotten any love lately is because of my new side project, PiX Eyewear. I won’t dive into all of the details here, but I maintain another blog detailing my experiences trying to start this business while continuing to work full time as a software developer. I’m using an e-commerce platform called Shopify for this project. Working with Shopify has been a very positive experience overall and has definitely given me an opportunity to venture out of the .NET development ...
Using a JavaScript function to show another window from an aspx page is pretty common. Often times you need to pass some variables by appending them to the URL string. And sometimes you don’t know which variables you may or may not need. This example shows one way of passing the variable(s) you need. The code below is going to pass some or all of the variables to a page that displays a map. The user may know some of the follow information about the site they are trying to find on the map like the ...
Windows Developers find themselves with more development options these days. This could be greatly due to the contribution of Visual WebGui which allows them to make the transition into Web or even Cloud development without having to learn new languages, concepts or development methodologies. The VWG platform is a unique springboard for desktop developers to jump into the deep waters of the Web programming world, wearing a life belt that protects them from all the foreign terms and concepts. New ...
Thanks a lot, everyone, for all your comments and feedback on my Five Little Wonders Trilogy of posts. This week, it’s crunch time at my workplace so this post is going to be on the brief side. As I’ve been coding on my latest project, it struck me that there’s at least two things that object/collection initializers can do that you can’t easily do without them. Refresher on Initializers For those of you who don’t know or can’t remember, object initializers are when you assign members of a class or ...
IE9 Beta 1 arrived today, and it looks great. The browser wars are back on and getting heated. The IE guys have been getting very bullish about performance on their blog site. See their post from a few days ago at http://blogs.msdn.com/b/ie/... Mozilla got beta 5 of Firefox 4 out of the door a couple of days ago and have hit back hard with various counterclaims see http://www.theregister.co.u... ...
We have come a long way since IE 1… image property of wikipedia …to IE9 In case you are living under a rock, IE9 Beta was released today. This browser is a major update to the previous version IE8. It is also supposed to give Firefox/Chrome a run for its money. How did it turn out? Read below to find out. So what are the best features of IE9? Lets give it a quick run-through then we are going to look at a few key features and a benchmark (note the benchmark is against a beta – so things may change). ...
in and between operators if (x in (1, 2, 3)) if (x in 1:5) if (x between(1,5)) · Like Python - Without having to use extension methods Data Structure Improvements · Make BCL collections to be generic: all this ControlCollection, XmlAttributeCollection, SqlErrorCollection, StringCollection becomes Collection<Control>, Collection<XmlAttribute> and Collection<SqlError> · Tuple Packing and Unpacking - Like python: public Tuple<string, int, double> ReturnMyTuple() { return "Hello ...
This week is my final entry in my Little Wonders series (posts one and two are here and here). These are those little tips and tricks in .NET (and in particular C#) that may not seem like much, but can help make your code either more concise, maintainable, or performant. Thanks again for all your comments and suggestions on this series, it has been a lot of fun to write, and though I feel I could go on forever with lots more tips and tricks, this will be the last Little Wonders post for a while. ...
So last week I began my series with a post (here) on those little wonders in .NET/C# -- those small tips and tricks that make code either more concise, maintainable, or performant. This is the second of my three-part series, though there are so many things that make .NET (and in particular C#) a great development platform that I'm sure I could carry this blog on ad infinitum. Once again, many of these are ones you may already know, but hopefully some of you will find something new or be reminded ...
It was always obvious that IE9 was going to get new chrome. Why else publish the technical previews with a mocked-up UI? The very fact that the IE team has cleanly separated the core browser technology from the old IE chrome indicates that they are free to change the whole look and feel of the browser if they wish. And of course, they must want to do so. Everyone loves the clean, zippy feel of Google's Chrome. If IE9 is to halt the slow slide in 'market share' that previous versions of the browser ...
We all have those little wonders in our .NET code, those small tips and tricks that make code just that much more concise, maintainable, or performant. Many of you probably already know of some of these, but many folks either overlook them or just don't know about them, so this article is a refresher. I'm planning on making this a three-part series encompassing 15 little wonders that I had thought of, though I'm very curious to hear the little wonders you can think of as well. Update: Part 2 is now ...
Another cool vector drawing JavaScript Library. Introducing Raphelhttp://raphaeljs.com/. Seems promising (Added to my R&D todo list :)) ...
Increasingly I find myself building web applications that rarely, if ever, reload the page. Ajax is used to communicate with the server and to update parts of the page as required. After much trial and error I have come upon a technique for organising the javascript on such pages. Consider an application that has three buttons: red, yellow and green. When one of the buttons is clicked an rectangle is coloured according to the selection. The UI design will be as follows: Here is the demo. The basic ...
Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.000... mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} I had started to write this ...
Let me start by saying, I love looking at other people’s code. I have learned so much by reading code that I would put that in a top 5 list of things every programmer should do. If it wasn’t for tools like .NET Reflector or Snoop then I would have missed reading a lot of great code. I started working in Silverlight a few months ago and wanted a utility to browse the tree nodes like Snoop does for WPF. I found several solutions but wasn’t happy until I stumbled upon Silverlight Spy 3 by First Floor ...
In this blog and in my column, I’ve written a lot lately about new technologies from Microsoft that seek to make software development easier. Technologies like ASP.NET Web Pages, Razor and WebMatrix, Access Web Databases and Visual Studio LightSwitch. Each of these technologies, I believe, is bringing much needed accessibility to programming on the Microsoft platform. I’ve also written about Windows Phone 7 which, despite extreme skepticism in the press and analyst communities, has the potential ...
After taking a lot of time with C# fundamentals, I decided to go down a different road this week and talk about some of the differences in C# that can be troublesome to people who are used to C++ development but are learning C#. My first post on this blog months ago was just a simple piece on how I divorced C++ as my first-love language (here). This is not to say that C++ is not still a valuable language, in fact as far as object-oriented languages go C++ is still king of performance. That said, ...
Over the past several years social media has grown from just a few sites to a booming industry. With the wealth of information and entertainment available on sites like YouTube, Facebook and Twitter, it is easy to see where it has come from and why it has stuck. Little wonder why people, developers and companies have sought to leverage the connections found on social media outlets to further careers, sell products or just plain connect to the rest of the world. Recently, I had been asked to develop ...
Last week I went into quite a bit of detail on C# struct (here) and the consequences of using a struct versus a class to represent complex data types. In the course of that article, I had a section describing the differences between value types and reference types and thought I would expand upon one of the ideas in there which seems to confuse some folks who are new to C#: parameter passing nuances. But first, let's lay the groundwork with some definitions: Parameter - the variable defined in a method ...
After few minutes of playing with new Microsoft Lab's gadget -> Zoom.it, I decided to share with you few comments. First It looks so nice and it gives a lot of fun :D Check for example how my blog looks like as a one image :D link: http://zoom.it/zFq1 Second Great API! Both, JavaScript http://zoom.it/pages/api/qu... and Silverlight http://zoom.it/pages/api/qu... Imagine DIGG with websites' preview in zoom.it :D And last but not least It not support Silverlight ...
In my previous post here I have demonstrated how to add dynamic rows in Gridview with a combination of TextBox and DropDownList. Just in case you need to validate empty TextBox values before adding a new row to the GridView then here's a JavaScript function that you can use for validation: function ValidateEmptyValue() { var gv = document.getElementById("&l... Gridview1.ClientID %>"); var tb = gv.getElementsByTagName("in... for (var i = 0; i < tb.length; i++) { if (tb[i].type == "text") ...
Microsoft Silverlight 4 Step by Step (click book logo to be taken to the Catalog Page) By: Laurence Moroney Publisher: Microsoft Press Pub. Date: June 30, 2010 Print ISBN-13: 978-0-7356-3887-7 Pages in Print Edition: 336 I decided to do my first review with the new Silverlight 4 Step by Step book from Microsoft Press. I have read the entire book and completed all of the exercises. I have found several errors in the book’s code, but they were not hard to figure out. Instead of writing a formal book ...

Extensions are a great way for you to add new features to Safari 5.0.1. Built by developers, Safari Extensions use the latest HTML5, CSS3, and JavaScript web technologies. And they’re digitally signed and sandboxed for improved security. You can install extensions with one click — no need to restart Safari.

http://extensions.apple.com/#productivity

This is the second in a series on architecting software solutions where I discuss items that need to be discussed, addressed, resolved, etc. prior to finalizing any system designs.. Part I of this series “Know Your Audience” can be found here. One of the easiest pits to fall in when architecting software solutions is to attempt to design the solution to be all things to all people. Unless the application is incredibly simple and/or has a very narrow use, it is possible to spend substantially more ...
Quick Link: download ASP.NET MVC Preview 1 It is a an exciting time to be a web developer. There are lots of new technologies from Microsoft coming out for the browser (IE9 changes everything), in the area of tooling (the brand new WebMatrix) and for the server – with ASP.NET MVC 3 Preview 1 released today (27th July 2010). Download and install side by side with MVC 2 If you have Visual Studio 2010 (The FREE Web Developer edition is fine) then you can safely download ASP.NET MVC Preview 1 (download ...
Visual WebGui which was designed to solve the most painful issues for enterprise IT is now with its new 6.4 RC0 version fullfiling its promise to reproduce client/server richness and user experience on Web and Cloud, in a simple cost effective way. "VWG was designed to solve what might be the most painful issues for enterprise IT; reproducing client/server richness and user experience on Web and Cloud, in a simple cost effective way and with standard Web, no-plug-in accessibility and absolutely secured ...
First of all, sorry for not posting for a quite long time. I have started working on designing and developing a charity website for blood donation. So all my leisure time was diverted into that. I will ensure that going forward, I post at least one post every week. Lets get into the topic of this week, without delaying any more time. I have always been using asp:Menu and asp:Treeview for transforming the sitemaps to super cool menu which are auto generated by ASP.NET for us. But I wanted more and ...
Most simple forms we write, especially in LOB applications, are repetitive sections of inputs and/or displays. Take a look at an exmaple from the MVC Music Store sample, the album editor template, notice anything repetitive? <%@ Import Namespace="MvcMusicStore"%> <%@ Control Language="C#" Inherits="System.Web.Mvc.Vi... %> <script src="/Scripts/MicrosoftAjax... type="text/javascript">&... <script src="/Scripts/MicrosoftMvcA... ...
http://www.microsofttransla... tool from Microsoft allows you to convert the language of your content on the fly. It is very intutive, effective and can be used for various locale generation requirements. It emits the below given <div> with the javascript:- <div id="MicrosoftTranslatorWidget" style="width: 200px; min-height: 83px; border-color: #3A5770; background-color: #78ADD0;"><noscript&g... href="http://www.microsoftt... ...
Two posts ago, I talked about the C# enum and some of its pitfalls (here). This post continues with a discussion of the fundamentals of enums by continuing with using enums and bit-flags. Defining a [Flags] Enum Now, we’ve seen previously that enums are typically used when you want to represent a type that can be one of a distinct set of values. But they can also be used to store a combination of discrete values. That is, the standard use of an enumeration is to support mutex options - such as an ...
Recruitment and interview process usually becomes complicated and very hard to follow with massive exchange of emails, bulky attachments and several people involved. So it was decided to develop a system that would simplify that process by allowing to find required information at a touch of a key - a web-based workflow-based application to automate the process without any need to install software on the client. The solution also needed to provide automated workflow to route tasks to the relevant ...
An article was published at JupiterJS.com (titled “JavaScript vs Silverlight”) arguing that JavaScript is better than Silverlight. Unfortunately, there is no way to post comments on that page (weird, really) so I decided I would post my answer here. Read the rest of this entry » ...
In my last fundamentals post, Chuck had requested an example of how to translate between enum and int without resorting to casting or other hard-coded mechanisms that depend on the actual values of the enum. One of the problems, of course, with casting between enum and int (for example to represent the enum as an int in database) is that it is a very tightly-coupled bond. Any changes to the underlying data or to the enum could have disastrous consequences. Thus, it is often more desirable to have ...
If you are working with iframe in which the content takes time to load, you may want to display a simple loading indicator to the end users instead of letting the users see a blank screen in the page. To do this, here's one way on how to implemet it using javascript. <html xmlns="http://www.w3.org/19... > <head runat="server"> <title></title> <script type="text/javascript"> function hideLoading() { document.getElementById('di... = "none"; document.getElementById('di... ...
Technorati Tags: jQuery,JavaScript I'm using the jQuery UI Autocomplete plug-in on my current intranet project, and am impressed with how powerful and easy to use it is. It works great on my development PC with Internet Explorer 8, and I was very pleased with myself. …until I tested on one of our "thin client" machines, and my beautiful autocomplete dropdown looked like Swiss cheese: The browser on the thin-client is, you guessed it - everybody's favorite browser - IE6. IE6 has z-index issues that ...
This week, Scott Guthrie, Corporate Vice President at Microsoft’s Developer Division, announced, via blog post, the early Beta release of a new tool called WebMatrix. WebMatrix is a free developer tool that enables Web development geared toward what might I might call Markup-and-Script developers (more on that in a minute). And although WebMatrix draws upon technologies already, or soon to be, present in the fuller ASP.NET Web development platform and the Visual Studio integrated development environment ...
Here is the function function getQuerystring(key, default_) { if (default_ == null) default_ = ""; key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regex = new RegExp("[\\?&]" + key + "=([^&#]*)"); var qs = regex.exec(window.location.... if (qs == null) return default_; else return qs[1]; } *taken from http://www.bloggingdevelope... ...
Continuing on the same vein as my last topic where I discussed differences between C# const and readonly keywords (here) and their uses, today I’m going to look at C# enums and their pitfalls. I will only be discussing the basic enums today (the post got kind of long so I’ll discuss enums marked with the [Flags] attribute next post). Quick Recap of Enums First, a quick recap of enums for those who are brand new or less familiar with them. Basically, enums a great way to declare a variable of a type ...
I've spent the last few weeks trying to comprehend OOP and inheritance in JavaScript. After that amount of time I've come to the conclusion that harly anyone really understands it and everyone implements it a different way. Just look at this question someone posted about the best library to use for JS inheritance. I thought it was funny because although there were a lot of answers, I think everyone proved his point, that there are many of them and no one could agree on the best. stackoverflow.com/questions... ...
I was recently tasked with coming up with a way to keep the session alive in ASP.NET as long as the user had the web page open. That way if they started filling out a form, then went to lunch and came back, they wouldn't lose all of the information just because their session timed out. The concept is actually pretty simple. You just need to make a call back to the server every once in a while before the session expires to update the session timeout. We figured as long as the user has the browser ...
When MVC 2 was released, there was a last minute change to use Model Validation instead of Input Validation. Essentially, Model validation means that your entire view model will be validated regardless of which values actually got posted to the server. On the other hand, with Input validation, only the values that get posted to the server will get validated. While this was the right decision by the MVC team for the most mainstream cases, there are still some cases where the previous behavior of Input ...
Technorati Tags: JavaScript Did you know that there are two equality operators in JavaScript? The one that's used most often is the double equal sign ("==") operator. The "==" operator does type coercion. The following example returns true, even though we're comparing a string and a number: if ('5' == 5) That's not too bad, but you probably wouldn't expect the following examples to return true: if (0 == '') if (0 == false) if (false == undefined) if ("\r\n" == 0) They all do though, thanks to JavaScript's ...
Once again we delve into the world of C# Fundamentals. Those hints and gotchas that tend to bite folks newer to the language. Today I take another look about the differences between const and readonly and the uses for each. For the purposes of this entry, whenever I say constant i mean a const or readonly. Const – Compile-Time Constant Values First of all, for those of you who came from the C++ and C# world, const in C# is not the same as const in that language. A const in C# can be closest considered ...
I was playing around with ASPNET AJAX MaskEditExtender control and ASPNET Validation controls when I was working with a profile page and doing some input validations. Everything seems to be fine until I was told to always retain the phone mask format in the TextBox. Here’s my code for Phone number masking: <asp:TextBox ID="TXTPhoneNumber" runat="server" MaxLength="13" ValidationGroup="GroupA" /> <asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TXTPhoneNu... ...
Technorati Tags: jQuery,JavaScript I'm sure I've "invented" a technique that's been done by many others (and I don't doubt that there's a slicker way to do it), but… Sometimes I'll want to have an identical chunk of HTML repeated more than once on a web page, for example: a search page with "Search" and "Clear Fields" buttons both above and below the search field inputs. I'd like to just render that HTML once on the server, than "clone" it on the client. For my site, I established a convention where ...