About the author

Steven HarmanSteven Harman is a passionate developer who believes that writing great software isn't just a job, its a craft.

ASP.NET MVP

For recent posts and more about me, scroll to the bottom.

Subscribe

  • Subscribe to my feed. via RSS
  • Subscribe via email via email

Jobs

Badges

  • Subtext Project
  • Support Subtext
  • HiddenNetwork.com Banner

javascript

There are 5 entries for the tag javascript

Add Option Elements to a Select List with JavaScript

While working on a web application I had the need to dynamically add new Option elements to a Select element (drop down list) using some fancy client-side JavaScript. The obvious solution was to do something like this: var theSelectList = $('theBigFatSelectList'); var myNewOption = new Option("My Option", "123"); theSelectList.selectedIndex = InsertNewOption(myNewOption, theSelectList); function InsertNewOption(newOption, selectElement) { var optsLen = selectElement.options.length; selectElement.options[optsLen] = newOption; return optsLen; } And it worked just as I’d expected. I got a new option in the drop down list and all was right with...

Use the PageRequestManager to Get More Control of Your UpdatePanels.

Being Web 2.0 is a hot topic right now. So much so that everyone and their mom is out to dress up their web presence with whatever Ajaxy goodness they can. Lucky for the Internet the ASP.NET AJAX framework has made adding Ajax functionality to asp.net web sites and web applications a pretty simple task. The simplicity is made possible because the framework hides much of the magical mechanics of doing the actual Ajax and DOM work behind a new control, the UpdatePanel. However, like most magical solutions this one comes at a cost. Actually a couple of costs. Two...

Lightbox and Subtext Galleries Integration

Recently several Subtext users have asked how to integrate Lightbox JS into Subtext's photo galleries. My standard answer has been Right now it's not possible because the control that renders the galleries emits links with relative URLs rather than fully qualified URLs. We'll look into making a change to the data binding mechanism for a future release - so hold tight! I finally had a few spare cycles so I looked into the existing data binding logic and realized that it is possible to get the control to emit fully qualified URLs right now! Notice, I said it's...

URL and HTML Encoding on the Client? JavaScript to the Rescue!

Phil recently wrote about some of The Most Useful .NET Utility Classes Developers Tend to Reinvent Rather Than Reuse - an article chock full of tasty tips, tricks, and reminders about [.net] framework features you forgot (or never knew) existed. One of the utility classes Phil mentioned was the System.Web.HttpUtility class. Two of the super useful methods this class offers are UrlEncode and UrlDecode... used to uh, convert a string into a URL encoded string and decode a URL encoded string, respectively. Do you encode? All web developers, regardless of language/platform, should be intimately familiar with the basic encoding schemes...

WebForm_PostBackOptions is Undefined - Check Your httpModules

While working on a new client application and ran into a bizarre issue with the WebResource.axd handler. The issue manifests itself as a JavaScript error when trying to do a PostBack from your WebForm. In IE7 you'll get the standard Error pop-up message informing you that 'WebForm_PostBackOptions' is undefined Not exactly the most useful error message. After a little JavaScript debugging in Firebug I found that the error was thrown because the WebForm_PostBackOptions method was missing. Yikes! How is it missing? As of asp.net 2.0, the Framework uses a new WebResource.axd handler to send assembly resources (like images, CSS...