Tag | Javascript Posts

The Sins of Our Education System As we all know, Agilists tend to frown on specialization. I am no exception. I tend to think that I take that sentiment a bit further though. I believe that designers should program and that programmers should draw wireframes. Before you dismiss me out of hand as a crackpot, hear me out. Hopefully by now, most UX designers (and hopefully some developers) have read The Design of Everyday Things. Hopefully those same designers have accepted that their difficulty with ...
MS VS Dataset Designer allows to create a relationship (a DataRelation object) that maintains information about parent-child records in two data tables in a dataset using Relation Dialog Box. It has option to specify type of relationship: Both Relation and Foreign Key Constraint Creates both a relation and foreign key constraint (see below for descriptions). Foreign Key Constraint Only A ForeignKeyConstraint restricts the action performed when a value in a column (or columns) is either deleted or ...
I wanted to implement client javascript to re-calculate summary based on a few options(in drop-down lists) selected by the user . The closest JS sample I found was Complex Client-Side Shopping Cart .But it wasn't exactly what I wanted. I created an array of custom class objects. Class has InitialPrice and SelectedPrice properties as well as this.Diff = function( ) { return this.SelectedPrice-this.Ini... } Each DropDownList calls onchange Event Handler, which updates SelectedPrice value and ...
Update: deadline pushed back (another week?) for the scripting contest. In case you missed it, the guys over at the PowerScripting Podcast are hosting a scripting contest. Hurry though, the deadline is Sunday! They’re giving away free licenses of NetCmdlets and PrimalScript 2007. Technorati Tags: PowerShell, NetCmdlets ...
Phil just announced that Subtext 2.0 is finally out. I haven’t been very active on this release (sorry guys!) but with the plans for 3.0 starting up I will be getting back into things a bit more. The new 2.0 release looks really good and includes some new features and bug fixes that will be nice to have. Now, we just need to convince Jeff and company to upgrade. Some of the improvements are: Enhanced MetaWeblog and WordPress API implementations New CSS-based admin section The ability to set a separate ...
Mark Monster on DynamicProxy and Function Pointers, Emil Stoychev with OlympicShow, Denislav Savkov with weather forecast control, Azret Botash with a MessageBox dialog, Rich Griffin with a Tag Cloud and Dependency Injection, Rob Houweling with SharpZipLib, Alex Golesh on dynamic creation/destroying SL objects, Mario Meir-Huber with a SL blog in German, and James Bacon on Downloading SL errors. I'm back from vacation... no trout, but lots of fish and cool air. This first SC Blog post after vacation ...
I have just heard about a new search engine in town - Cuil. Apparently it pronounces "cool". Immediately I rushed to try it out. I can tell it is worth experimenting with, although the results returned were less relevant than using Google. So Google is a king to me still, but all in all the visual appearance is more appealing to me so I added this engine to my search engines array inside the IE that immediately hang and FireFox 3 that survived this brutality. Anybody up to improving ones searchs ...
Invoking web methods from client scripts is fun. But before you roll out your cool applications into the production, please don't forget to reconfigure the max JSON string length, represented by either the maxJsonLength value in the web configuration file or the MaxJsonLength property of the JavaScriptSerializer class. The maximum length of JSON strings, by default is 2097152 characters, which is equivalent to 4 MB of Unicode string data. This should be good enough for most of the web applications. ...
A solution to the EmptyDataTemplate problem: how to insert via GridView when table is empty. This is Oracle-based and does not use a SqlDataSource. If you have worked with the GridView feature for any length of time, then you probably have had to address the "EmptyDataTemplate" situation, where there are no records in the table from which you are pulling. Here is a sample screen shot of the typical solution when the table is empty. This solution will work, although it is not too elegant. Also, it ...
Okay...so, the post yesterday was clearly not as researched as it should have been. It's true...the Click() event does NOT work in FF...so, the solution I had to utilize the click event had a rather short lifespan. I tried to dynamically add the __onPostBack javascript event onKeyPress as well as onkeydown - to no avail. I'm not sure why it wouldn't work...but, it just wouldn't. (I'm using an image button, .NET 3.5, a lot of JS & AJAX on the page - not sure what, if any of that muddies the waters) ...
OK, I have heard you loud and clear, the comments suck in SubText and on Geekswithblogs.net. I agree, but I don't have near as many problems with people being able to comment as others do. This leads me to believe the problems lay in two places, the skins or the custom HTML code fields. Most of the time when I am debugging a blogger with comment problems they are due to some javascript they have embedded into the news section of their blog. However, this is a problem so we need to get it fixed so ...
UPDATE: If you're looking for the solution that will work in FireFox & IE...Go here Okay, I admit, this is yet another post so I know where to go in 3 months when I totally forget this day. Long story short: I was trying to use the DefaultButton property on a panel in order to get a button clicked by default when a user hits enter on my search form. I was using an ImageButton, and surprise! That won't freakin' work! Seriously...try it. I came across a post on here ( http://bytes.com/forum/thre... ...
Dependency Injection I have recently caught up to date with common patterns and practices today. One I was looking at was Dependency Injection. Simply put, it's amazing. I can not think of a single better way to make your code maintainable. I recommend that everyone who hasn't yet had time to tinker with it download a toolkit and see what it can do for you. I then started thinking about the practical implications of dependancy injection. Sure, it's great for creating objects with static operations ...
You can definitely find this information elsewhere But...I'm going to put it here right so I know where to go next time :) I have/had a situation where I had a modal control on my master page - it's what I'm using for a user to log into my application. I have many pages that need to call this - but I needed a way to call the show() method on my modal pop-up, from javascript. Here is the solution... var modalOnmaster = $find("ctlModalPopupBehavio... modalOnmaster.show(); Thank you Brett ...
Hi, I started proper programming with Java in 2001 and since then I was knew that Java is a language that has "Pass by value" for primitives and "Pass by reference" for the non-primitive types. I left programming in Java in 2004 and started using C#. Since last few months again I started part time development in J2ME and last week I came across a very interesting thing. I was sending a byte array as a parameter to a method and expecting to get the same parameter as an initialized array but I don't ...
Mark Monster on Mocking SL and Networking, Denislav Savkov inheriting from ItemsControl, Alex Golesh on SL Events in JS and vice verse, Edward Silverton with a SL Portfolio site, Dave Relyea on Templating, Page Brooks Controlling his Treadmill, Lee on TabStrip and vertical text, Robby Ingebretsen surveying SL and 3D, Expression Team Blog with Resource links, and Jesse Liberty with four Twitter Blogs. Congratulations To The Winners of Silverlight 2 “Write and Win” Contest ... Somewhere along the line, ...
I love standards -- a lot. I can't even tell you how much I love standards. I sing the joys of standards every day that I'm allowed to use them. Wait-- what was that? Allowed to use them? Sadly, its true. In some of the systems I work on the only way to make a system work is to make it work in an unsupported way. quirks in IE frequently don't help that process. So I'm going to talk a little bit about standards now, specifically as they pertain to the html tag <button>. A friend of mine was ...
There are many areas where optimization may occur, and the resulting solution may be different for different areas of concern. In an ASP.NET application, delay may occur in the following places: On the client (within Javascript) Along the network between the client and the web server (lots of information on the page getting submitted, in ViewState or otherwise) On the web server during processing and/or rendering On any other application servers during processing Along the network between the web/app ...
I've alluded in the past that I got my start in computers because of games; I also ended up getting started in programming because of games. I happen to be a big fan of the WarCraft and StarCraft series produced by Blizzard Entertainment, and it was my association with (and desire to make a good website for!) a group of people on their gaming service called Battle.net that got me involved with programming, and that's where the "Fun" part of this comes from. I'm not sure where "Profit" comes into ...
So I stumbled upon a cool new utility for web testing called Browser Shots. Browser shots will provide screen shots of the URL you send it in many different browsers. The full list of browsers can be seen here: As you can see from the image, you have the ability to select from multiple OS's and their browsers as well as set the Screen Size, Color Depth, whether Javascript is off or on, whether Java is off or on, and whether Flash is installed. This application is free, however you do have to wait ...
Hi, I was looking a simple way to be able to encrypt and decrypt my Connection Strings. I searched in the net but all i could find was Encrypting and decrypting Connection Strings using aspnet_regiis utility or by creating custom Encryption and decryption classes. Finally I could a very good way to do encryption and decryption using .NET class library. You can find the video of the tutorial in asp.net , Videos section (Video is called ASP.NET Tips and Tricks) or read it HERE . I am placing a sample ...
As with most spatial operation, every ESRI - ArcGIS / Mapobjects developer or end user in the GIS world prefer a spatial selection by drawing a rectangle or a polygon. Off-course its easy with desktop application, Try that with a javascript, its different challenge. I have started working on a Virtual Earth with MOSS project recently and I must say Iam definetly impressed compared to Google earth / Google Maps. I will post another article shortly after this on comparing the two products and my preference ...
Hi, After spending few years in IT I learned that we can find a lot of coders to code in projects but what we cannot find is GOOD CODER. By Good coder I mean someone who has good understanding of the problem in hand and can file a solution for it based on the best possible way. Further who can code based on standards and keep in mind best practices. I have been using FXCop for a long time and I love using it in my projects. Yesterday I came to see something new (for me) called StyleCop. I liked the ...
Found a great resource today in SpringWidgets.com. The website allows you to pretty easily create, distribute, and track your own countdown and feed banners. Take a look at the widgets I created in about 20 minutes here. While there are many other banner automation wizards on the web, SprngWidgets does an exemplary job at making the distribution process a breeze. Whether you want the widgets integrated into Facebook, MySpace, Blogger, Mac Dashboard, or you just want the HTML or Javascript code to ...
I found a new Twitter toy today. It is called TweetMyPage. It is not an application that needs an installer. You setup your settings and TweetMyPage gives you a javascript you add to your bookmarks. When you are reading a page you want to Twitter, you click on your TweetMyPage bookmark and it will ask you for your Twitter user id and password. Once you give it your credentials it will tweet a message similar to the following: Reading (http://linktoarticle) title of article. Currently TweetMyPage ...
Software development satire

In software development, communication is key. Here's a popular email forward describing the reality of software development and the miscommunication prevalent.
I've tried using FCKEditor 2.6.2 for an ASP.NET web application I was working on and it's really cool. You can check out a demo of the editor here: http://www.fckeditor.net/demo Unlike the version of FCKEditor on GWB (GeeksWithBlogs.com), we don't have a separate popup browser window. A common problem on GWB's FCKEditor is when you're done using the popup browser window, it doesn't automatically close. The new version certainly ranks higher on user-friendliness ...
For those of you who don't have access to IE or FF dev toolbars - this is how we used to do client side runtime debugging... Drop the following code into your web page (preferrably at the bottom): <script> function log(text){ document.getElementById("lo... = text; } function dump(){ log(document.body.innerHTML); } function logProps(obj){ var msg = ""; for(var i=0;i<obj.attributes.len... { msg+=obj.attributes[i].node... + ": " + obj.attributes[i].nodeValue + "\r\n"; } log(msg); ...
For some reason some controls/tags within ASP.NET do not always get rendered/passed to the client. This has happened to me on a number of occasions. It seems limited to <style> and <script> tags - but happens for both raw HTML (within the aspx designer) and dynamically created tags (eg using new HtmlGenericControl("style")... This is happening to controls/tags within AJAX updatepanels within, webforms and usercontrols. Sometimes I can work around this by simply placing these controls/tags ...
I found a new video showing AJAX (Ajax.NET Professional), JavaScript and jQuery. On the Web server they are using ASP.NET. (Note: you need Silverlight for the video player) Download video as WMV ...
Martin Mihaylov on the MultiscaleImage control, Tamir Khason on Visual Tree and thickness, Mike Snow on SL and JS, Donavon West on DeepZoom Obama, Video Player by David, Jesse Liberty's Styles and Templates Tutorial is Up, Frank LaVigne on Swift3D and SL, and Andy Beaulieu resolving Default.aspx being executed. From SilverlightCream.com: Tip: Maximal and minimal zoom level in the MultiscaleImage control Martin Mihaylov resolves a problem I've noticed in DZ apps ... that you either zoom the image ...
What we need in ASP.NET is a change-tracking control. Whenever we modify elements on a form, it would be a good idea to display a popup for user confirmation before navigating away from the page. Right now, I've got some pretty ugly Javascript doing this.

The next version of the AJAX Control Toolkit would really kick a** if it had this control. It could also include bug fixes for the 'focus' issue with the RoundedControlExtender and TextBoxWatermarkExtender.
The following javascript error occurs when trying to use the Telerik controls and you haven't updated your ASP.NET (2.0) web.config file correctly. Error: 'Telerik' is undefined To fix make sure the following lines are within the <system.web> section of your web.config file: <httpHandlers> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.S... System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad36... validate="false" ...
A search comparing the StringCollection to the ArrayList may give you articles that say "the ArrayList works better than the StringCollection" but what you need to know is that a StringCollection is simply extra methods over an ArrayList - there is an actual ArrayList included as a private member within the StringCollection class and it caters to storage needs of StringCollection. In other words, the StringCollection is just a disguised ArrayList! You don't really have to decide between using an ...
I am by no means a search guru, but at work they have tasked me with creating custom search scopes. What they want is the ability to search a bunch of document libraries of a specific name in bunch of office sites. John Ferringer gave me this awesome link: http://blogs.microsoft.co.i... I figured that I could somehow use it to create custom scopes for the document libraries. I started playing around and ...
I've been running a couple of tests on the ArrayList and the StringCollection in .NET 3.5 to determine if the ArrayList still performs better than the StringCollection for insertions. There are a couple of articles on it, this one from 2004 being the one that also presents source code for a simple test that they've performed: http://weblogs.asp.net/just... Initially, I went with a normal-looking test but without creating the string table and that skewed the results. ...
UPDATE: The component controller was removed from the MVC framework before the RTM release. For an updated version of this post, click here. At some point when creating a web app, you're going to want some reusable UI components. This might be because you want the same visual UI snippet repeated more than once on a single page or it might be because you want to use the same component on multiple pages. In a traditional ASP.NET web app, typically you would use a User Control for this type of thing. ...
Due to much frustration and lost time, I'll try to summarize in this post the "naming" conventions to be used when defining and/or referencing IDs (some of which are, in fact, GUIDs, and others contain GUIDs) in Sharepoint 2007. If you're thinking "what the heck?! aren't GUIDs always the same format?!" you're half-right: they should be, but not in sharepoint. So if you're a newbie to sharepoint 2007 (or wss 3.0) like me, the following tips regarding how element id's should be written might save you ...
For some reasons, it took me a few google search attempts to find the following tools: MSDN includes Workflow Monitor Sample -Windows executable to view details of tracked workflows. When downloaded, copy EXE to your bin directory when custom workflow DLLs are located. Ensure that tracking database doesn't have too many instances, to avoid timeouts. Jon Flanders put together the ASP.NET implementation of the Workflow Monitor SDK sample. MSDN Tracking Samples mostly described how to store tracking ...
Visual Studio 2005 SP1 added in a couple of _designer:wfdid attributes into some of my ASP.NET tags and they prevent the project from compiling. Apparently, there's a bug somewhere that didn't get fixed with the service pack.

Removing the attribute fixed the compilation error.
Since the downtime at GWB, I've been cooking up content that has been going onto my BlogSpot mirror and I've been too lazy to paste them all here one-at-a-time so here are the links: Model View Controller (MVC) Design Pattern http://knitinr.blogspot.com... Yet Another Twitter-Cline: Identi.ca launched http://knitinr.blogspot.com... Error Pages: ReddIt and Acromedia http://knitinr.blogspot.com... ...
Michael Washington on prompting for install, Peter McGrattan updated his Stock List Demo, Joel Neubeck on Timeline Markers, Alex Knight DeepZooming, David Anson on LayoutTransoform, and Tim Heuer on Silverlight.js & FF3. Christopher Bennage has an interesting WPF article on TemplateBinding that if not directly related to SL, it's close. A couple days ago I referenced the Silverlight 2 RefCard from DZone, and since then have gotten a copy of the PDF file... this is very nicely done... it has an ...
While GeeksWithBlogs was down, I was able to continue blogging thanks to the blog hosting service provided by Blogger.com for my blog mirror. I posted an article there comparing jQuery Corner with the AJAX Control Toolkit, which you can read about at:
http://knitinr.blogspot.com/2008/07/rounded-corners-comparing-jquery-with.html
We've all done it. More often than we'd like to admit. Yesterday I spent half a day working on an issue where the end result turned out to be SO SIMPLE as to make me ashamed to call myself a developer. There was the feeling as I slogged through the problem that "This shouldn't be this difficult". When the problem resolved with 4 simple lines of code, my giddiness with solving the problem was tempered by my feeling like a complete idiot for having spent half a day producing those four lines. Hearing ...
I just Plurked a little while ago. No, I'm not ill - Plurking is the act of posting a message on Plurk (weird name, I know!). It seems to be like Twittering, except that it doesn't have the mobile (maybe they do and I just haven't found it yet?) or IM elements to it - you have to be at a web browser to use it. Their timeline interface is quite nice and is their unique selling point. I wonder how long it'll keep them ahead though - there are so many browser add-ons, desktop applications and web front-ends ...
Have I got a great resource for all you Plurkers! Plurkable.com has started a weekly Plurkcast to show off the people and events of the Plurkiverse. I am going to be joining the Plurkable team and Mike Templeton on this afternoon's show. I know it is short notice, but come join us anyway. Details: July 2nd PlurkCAST @ 4:00 PM US Central Time Live Chat Room visit the official TalkSHOE PlurkCAST page Call In Phone Number: (724) 444-7444 Call ID: 21651 Hosts: Eric Odom of Plurkable.com and KDFrawg of ...
iStockphoto has a cute error page (though not as cute as Twitter's!). Check it out:

You've probably read my earlier post about setting focus on a form element. All went well. Then, things went to the U.I. guy who went crazy with the TextBoxWatermarkExtender control and now none of your forms have focus on a form element any more :-( I guess the developers of the TextBoxWatermarkExtender didn't think of all the possible ways in which people would use the control - some people actually do want to keep the focus on a control to help their keyboard-loving users. Anyway, I set out to ...
I recently read "Microsoft Silverlight to back Ruby, Python in browser" at http://www.infoworld.com/ar... I'm very curious to see whether Ruby and Python, as alternatives to JavaScript, will have a serious impact in the ISV community. I definitely think the capabilities extended by these two additions will definitely feed the community and drive for the addition of Perl and PHP support within Silverlight ...
This Sunday, I went to dotNETwork 5th gathering to see how interesting it would be to have some Silverlight fun followed by SOA and Patterns and Anti-Patterns goodness. It was a really fun day, and here comes its writing as I saw it. Starting Out (No tech – you can skip) The day started by meeting Mohamed Samy (the SOA guy, and my friend!) at 10 AM, getting some sandwiches (and coffee for me as I didn’t have sleep the night before), then, going to the buses place in El-Sekka club (as neither of us ...