ASP.NET News from Blogger: Scott on Writing   Get the feed of: Scott on Writing

Total News: 304

ERROR: Resource name XXX cannot be used more than once

A couple weeks ago I had a client call me up with a perplexing build error. He had an ASP.NET 4 Web Application project open in Visual Studio 2010 that he was working on when, suddenly, the following ...

Using Log Parser to List All Blocked IP Requests

In a recent project we needed to block a series of IP addresses from accessing our website. IIS makes this easy with its IPv4 Address and Domain Restrictions feature, which lets the webmaster specify ...

Uploading a Variable Number of Files from an ASP.NET Web Page

ASP.NET has long offered the FileUpload control, which simplifies uploading a file from the clients computer to the web servers file system. This control provides a very simple, straight-forward user ...

Using Templates to Display Boolean Values as Yes/No Options

One of ASP.NET MVCs most useful features is its powerful templating system. Templates were introduced with ASP.NET MVC 2 as a way to have the view render either a display- or editing-related user inte...

Searching SQL Server Stored Procedure and Trigger Text

While I like to consider myself a web developer, every now and then I have to put on my DBA hat to address some SQL related issue. This little script has saved my butt more than once. It searches the ...

ASP.NET Training in San Diego on Saturday, September 24th

On Saturday September 24th Ill be doing two four-hour ASP.NET MVC 3 and Razor training events in San Diego: Getting Started with ASP.NET MVC 3 and Razor (8 AM to Noon) - This four hour morning cl...

Full Day ASP.NET MVC 3 Training Event in Los Angeles on August 27th, 2011

In conjunction with the Los Angeles .NET Developer's Group I will be presenting a full day, hands-on lab/presentation/training event on ASP.NET MVC 3 Tips, Tricks, and Best Practices on Saturday, Augu...

Creating a Currency Masked TextBox with On-the-Fly Currency Formatting

By default, a user can enter any character into a textbox. Masked textboxes help reduce user input error by limiting what characters a user can type into a textbox. Masked textboxes have been a standa...

A Synchronized Visual Studio Crash

About month ago at a user group meeting the guy sitting across from me shared the tale of a talk he had attended. The speakers laptop had downloaded a slew of Windows Updates in the background, after ...

Export an ADO.NET DataTable to Excel using NPOI

My latest article on DotNetSlackers looks at how to create Excel spreadsheets using NPOI. NPOI is a free, open-source .NET library for creating and reading Excel spreadsheets and is a port of the Java...

Full Day ASP.NET MVC 3 Training Event in Los Angeles on May 21st, 2011

In conjunction with the Los Angeles .NET Developer's Group I will be presenting a full day, hands-on lab and training event on ASP.NET MVC 3 on Saturday, May 21st. The event is a 8 hour training with ...

Terse Markup and CSS for Aligned Form Labels and Inputs

Like many ASP.NET developers, I am most comfortable working with C# and VB. I know just enough HTML and CSS to be dangerous. I know enough to implement the overarching page layout without using <ta...

Ive Written My Last Article for 4GuysFromRolla

Warning! This blog post is long and rife with navel-gazing. In 1998 I started an ASP resource site, 4GuysFromRolla.com. Toward the tail end of the dotcom boom I sold 4Guys to Internet.com, but contin...

The Average Number of Words and Points in Boggle

Boggle is a word game trademarked by Parker Brothers and Hasbro that involves several players trying to find as many words as they can in a 4x4 grid of letters. At the end of the game, players compare...

My Latest Articles From Around the Web

In addition to my regular articles on 4GuysFromRolla.com, Ive recently authored a number of articles that have appeared on other websites: Use ASP.NET and DotNetZip to Create and Extract ZIP Files...

Select a textboxs text on focus using jQuery

A fellow ASP.NET developer asked me today how he could have the text in a TextBox control automatically selected whenever the TextBox received focus. In short, whenever any textbox on the page receiv...

Removing Gaps and Duplicates from a Numeric Column in Microsoft SQL Server

Heres the scenario: you have a database table with an integral numeric column used for sort order of some other non-identifying purpose. Lets call this column SortOrder. There are a many rows in this ...

Customizing ELMAHs Error Emails

ELMAH (Error Logging Modules and Handlers) is my ASP.NET logging facility of choice. It can be added to a new or running ASP.NET site in less than a minute. Its open source and its creator, Atif Aziz,...

jQuery Usage Among Top Sites

If you use jQuery on your website two things to consider are: What version of jQuery to use, and How should the jQuery library be referenced from your website Concerning the first question Id...

Resetting Form Field Values in an ASP.NET WebForm

A recent question on Stackoverflow.com asked if there was a general method to clear a form in ASP.NET. The person asking the question had a form with many TextBox and DropDownList controls and wanted ...

Checking All CheckBoxes in a GridView Using jQuery

How do I love thee, jQuery? Let me count the ways. In May 2006 I wrote an article on 4GuysFromRolla.com titled Checking All CheckBoxes in a GridView Using Client-Side Script and a Check All CheckBox,...

Just Where Is WebResource.axd?

I stumbled upon and answered a question at Stackoverflow this morning Where is WebResource.axd? and thought it might be worth to elaborate a bit on the question and answer here, on my blog. But fi...

Returning Dynamic Types from an Ajax Web Service Using C# 4.0

Over at 4Guys Im authoring a series of articles showing different techniques for accessing server-side data from client script. The most recent installment (Part 2) shows how to provide server-side da...

Enumerating Through XML Elements Using LINQ-to-XML

4Guys reader Dan D. recently emailed me with an inquiry surrounding my article series, Building a Store Locator ASP.NET Application Using Google Maps API, specifically on how to access a different set...

Use jQuery to Open External URLs in a New Browser Window

As any web developer knows, the HTML anchor element (<a>), when used in the following form: <a href="http://www.scottonwriting.net">Click Me!</a> creates a hyperlink with...

Adding a RESTful Service to My Boggle Solver

My immediate and extended family enjoys playing games, and one of our favorites is Boggle. Boggle is a word game trademarked by Parker Brothers and Hasbro that involves several players trying to find ...

Enhancing the Store Locator ASP.NET MVC Application to Include Directions

Earlier this year I wrote an article on 4GuysFromRolla.com showing how to build an ASP.NET WebForms store locator application using Google Maps. Recently, I ported the store locator application to ASP...

Im Teaching Two Upcoming Training Classes in San Diego

Once a year (or so) I teach a handful of one-day, four hour classes in San Diego on various ASP.NET topics. Ive got two such classes lined up for Saturday, September 11: Get Started with ASP.NET M...

Hot Off the Presses Teach Yourself ASP.NET 4 in 24 Hours

Yesterday I received the author copies of my latest book, Teach Yourself ASP.NET 4 in 24 Hours. When signing the author agreement many, many months ago, there is typically a clause that promises the ...

Using the GeneratedImage Control in ASP.NET MVC

One of the free, open-source controls on the ASP.NET teams CodePlex page is the GeneratedImage control. In a nutshell, the GeneratedImage control is a combination of an ASP.NET Web Control and a set o...

I Am Now Tweeting (Or is it Twittering?)

Last week I received an email from Srikanth Pragada, a .NET trainer in southern India, asking why I did not have a Twitter account. I had two excuses. First, I am somewhat of a Luddite when it comes t...

Two Upcoming ASP.NET Local User Group Talks in August

This month I will be giving two talks to .NET user groups here in San Diego. Take Control of Your Website's URLs with ASP.NET Routing - Tuesday, August 17th at 6:00 PM at the ASP.NET Special Interest ...

Links to Scott Guthrie's Using LINQ to SQL Tutorials

Back when Visual Studio 2008 came out, Scott Guthrie wrote an excellent series of blog posts on using LINQ to SQL. Unfortunately, the various installments are not easy to follow when starting from Par...

A Review of Desktop / Screen Sharing Software

I work as an independent consultant and trainer. Most of my business involves me meeting with clients (in person or online), discussing their needs, and then building a new application or enhancing an...

HOWTO: Update Records in a Database Table With Data From Another Table (MS SQL Server)

SQL's UPDATE statement makes it easy to update one or more records in a database table. The most common UPDATE statement pattern assigns static or parameterized values to one or more columns: UPDATE M...

Determining an ASP.NET Page's View State Footprint

ASP.NET view state is the technique used by an ASP.NET Web page to persist changes to the state of a Web Form across postbacks. The view state of a page is, by default, placed in a hidden form field n...

I'll be speaking at the SoCal Code Camp this Weekend

The SoCal Code Camp is coming to San Diego, California this weekend, June 26th and 27th. This free event boasts nearly 100 talks given by dozens of speakers from around the area covering a wide swath ...

New Software Running ScottOnWriting.NET

When I started this blog in July 2003 there weren't many available blog engines build atop ASP.NET. One of the more interesting ones at the time was Scott Watermasysk 's .Text blog engine (which event...

Building a Store Locator ASP.NET Application Using Google Maps API

The past couple of projects I've been working on have included the use of the Google Maps API and geocoding service in websites for various reasons. I decided to tie together some of the lessons learn...

Resolve a URL from a Partial View (ASP.NET MVC)

Working on an ASP.NET MVC application and needed the ability to resolve a URL from a partial view. For example, I have an image I want to display, but I need to resolve the virtual path (say, ~/Conten...

Authorize.Net, Silent Posts, and URL Rewriting Don't Mix

The too long, didn't read synopsis: If you use Authorize.Net and its silent post feature and it stops working, make sure that if your website uses URL rewriting to strip or add a www to the domain nam...

It's Here! Visual Studio 2010 and ASP.NET 4.0 Ship

Today Microsoft released Visual Studio 2010 and ASP.NET 4.0. I've been using the RC version of Visual Studio 2010 quite a bit for the past couple of months and have really grown to like it. It has a h...

Determining Whether a String Is Contained Within a String Array (Case Insensitive)

About once every couple of months I need to write a bit of code that does one thing if a particular string is found within an array of strings and something else if it is not ignoring differences in c...

FIX: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS

I teachtwo six week courses on ASP.NET at the University of California - San Diego Extension. The first class serves as an introduction to ASP.NET and as such many of the students create their first A...

SOLUTION: Outlook Is Stripping Line Breaks From Plain-Text Emails Auto-Generated From My ASP.NET Application!

Today I was working on an ASP.NET application that sends out plain-text emails to site administrators when certain conditions unfold. One problem I unearthed today is that when viewing these emails in...

Configuring the PasswordRecovery To Send Email to an SSL-Enabled SMTP Client

ASP.NET'sPasswordRecovery provides a mechanism for users to recover their forgotten passwords. Depending on how user passwords are saved, the PasswordRecovery control will either email a user their pa...

November's Toolbox Column Now Online

MyToolbox column in theNovember 2009issue of MSDN Magazine is available online and includes the following reviews:BI Documenter- point BI Documenter to the schema of your database andselect which data...

TIP: How To Generate a Fully Qualified URL in ASP.NET (E.g., http://www.yourserver.com/folder/file.aspx)

Imagine that you've got an ASP.NET page that is generating an email message that needs to include links back to the website. Perhaps you're writing the next greatest online message board application a...

Rich Tooltips With jQuery

I was recently working on an application and needed the ability to present the user with a list of links when they hovered over a particular line of text. HTML elements include a title attribute that,...

SOLUTION: JSLint.VS Add-In Always Reports "No Errors" Even For Invalid JavaScript Files

JSLint is a freeJavaScript code quality tool createdby Douglas Crockford. At the JSLint.com website you can paste in a block of JavaScript code and JSLint will examine the code and warn you when it en...

View Other bloggers