Tag | Javascript Posts

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 ...
Allowing keyboard navigation and improving the User Experience for users is usually a concern for web developers. Some use Flash frontends while others go the AJAX route but in the end it's the simple things that matter, such as setting the focus to a input element on a form. Setting the focus on an ASP.NET control is quite simple in ASP.NET and there are at least half a dozen ways to do it. Through server-side ASP.NET code, you can: 1. Set the DefaultFocus property of the form (you can also do this ...
There are two things about Twitter that have been giving it a lot of press lately - lots of downtime and really cool images on their error pages. The one thing that keeps them from getting bad press resulting from downtime is the graphic design team. As much as I like their graphics, I really hope this doesn't become a trend - replacing support engineers and developers with graphic designers. In case you haven't caught on to the Twitter wave yet, you can see the error pages here ...
According to the CSS Compatibility report for Microsoft Internet Explorer browser version 5 to 8 published here, Microsoft doesn't intend to support the border-radius attribute of CSS 3 anytime soon - both Internet Explorer 8 Beta 1 and Internet Explorer 8 RTM will not have support for the property that can save us all from having to download tiny images of curves (not *that* kind of curves!) to view rounded borders. Firefox supports the border radius, although it needs the "-moz-" prefix ...
jQuery is a JavaScript library to interact with HTML, create simple animation and add AJAX capabilities. It works across browsers (don't most things do today?), and lets you do more with less. If you're in the web design & development work, you would have heard about it unless you've been living under a rock, figuratively speaking. jQuery was released in January 2006 and is licensed under the GNU GPL and MIT license. In other words, jQuery is open source and available for free! The library itself ...
There's a really cool way to extend an ASP.NET button's functionality in JavaScript and that's by getting ASP.NET to render the button as an Input Button control instead of an Input Submit control - this is done by setting the UseSubmitBehavior property to False. You can call GetPostBackEventReference to get the Javascript to call the onClick event handler for the button if you need it - this is appended to the OnClientClick handler automatically. A practical usage scenario is when you want to use ...
The latest release of the MVC framework provides the JsonResult for Controller actions. I was surprised that I did not find a weatlh of examples for usage so I figured it shouldn't be too hard to get a decent example going. It turns out, it was even easier than I anticipated. I wanted to create an example where I would invoke an AJAX call to dynamically populate a dropdown list. jQuery has recently received a huge surge of interest of the ASP.NET MVC community so I've been getting up to speed on ...
In Visual Studio 2008, the IDE now adds a content placeholder in the header of the master page document by default. In Visual Studio 2005, the IDE would only add the content placeholder within the form tag in the document body and would display the squiggly underline if you tried to add one into the header although it would still compile and run perfectly well ...
The ASP.NET Wiki is down today. It just displays a big Service Unavailable message with an HTTP Error 503. If you've been running 32-bit and 64-bit assemblies on IIS and get the Service Unavailable 503 message on your server, David Wang has a blog entry about it here ...
Hi-ho! I have just found a service to translate English into scurvy pirate lin'o. It be at http://postlikeapirate.com . It can message directly to twittArrr, PirateSpace or email too. Errr... what I meant to say is: Hi! I have just found a service to translate English into Pirate lingo. It is at http://postlikeapirate.com . It can post directly to twitter, myspace or email too ...