AJAX Drop Down List – Part One

I wrote a tutorial on using AJAX technology in ASP.NET applications, and it only shows a very simple but common use of AJAX. Another common use of AJAX is to populate a drop down list based on the selection of another drop down list without using post back. It is especially useful when populating a large drop down list and the connection is not so fast. Let’s get started. Before we go too far, let’s […]

“ConstraintException Was Unhandled – Column is Constrained to be Unique…” error

I like to use DataAdapter to create a Data Access Layer to manipulate data in my applications. One of the advantages of using DataAdapter is that it allows you to insert/update/delete data in a batch mode by using Strong Tyed DataTable. How it works? Every record in the Strong Typed DataTable has a property called RowState that keeps track of the status of the record. For example, when a record is deleted from DataTable, the […]

I fixed our laptop!!!

Our old laptop has been giving us problems for about two years. When I am surfing the Internet, the laptop will freeze up unexpectedly, especially if I scroll the page up and down frequently, then the laptop will freeze up. I have tried several ways to fix the problem, but in vain. Here are the methods I have tried before: Reinstall Windows XP. Yeah, it is always our first choice when we deal with Windows […]

Oracel Date function

When it comes to handling date and time, Oracle PL/SQL is not as easy or convenient as Microsoft SQL. For instance, with MS SQL, you can write a query like: SELECT * FROM SomeTable WHERE DateAdded = ’09-29-2006 08:00:00 AM’ But with PL/SQL, the above query will not run and will generate an error message like ‘not a valid month’. To make it work, you have to use “To_Date” function to convert the DateTime string […]

How to make a HTML table fill the whole screen

When creating a table with width=100%, the table will not fill the whole screen and there is a thin white space between the screen and the top, left, and right side of the table. To make the table actually fill the whole screen, we need to use CSS. In the CSS file, add “margin: 0px; padding: 0px;” to the Body tag as follows: Body { … margin: 0px; padding: 0px; } If you use FireFox, […]

File size limitations with the File Field Control in ASP.NET

By default, the maximum size of a file to be uploaded to the server using the File Field control is around 4MB. But we can make some changes in either the machine.config or web.config to increase or decrease the size limitations: In the machine.config file, find a node called <httpRuntime> that looks like the following: <httpRuntime executionTimeout = “90” maxRequestLength = “4096” useFullyQualifiedRedirectUrl = “false” minFreeThreads = “8” minLocalRequestFreeThreads = “4” appRequestQueueLimit = “1000” /> […]

Designer causes a Just-In-Time Error

Recently, I am getting a Just-In-Time error with Visual Studio.NET 2003, and the error is very unpredictable. It happens when I am working in the Designer. Last time it happened was when I selected a TextBox control and moved my mouse over the Properties Window(I set my Properties Window ‘Auto Hide’), then I got a dialog box that stated “Just-In-Time Debugging. An exception ‘System.ExecutionEngineException’ has occurred in DefaultDomain.” And then I got a choice of […]

Run server control event handler before executing javascript

Sometimes, we need to run the event handler of a server control before executing some javascript code. For instance, when user clicks a button called “Save and Close Window”, the application saves data into database, then closes the window automatically. How can we accomplish this? We can’t add an “onclick” javascript to the button’s attributes, because if we do, then the application will run the javascript code and thus close the window before it even […]

Datagrid inline editing problem: textbox does not hold new value

I had a problem with DataGrid inline editing last Friday: I click the “Update” LinkButton in the DataGrid, but the DataGrid still shows the old value. After stepping into the source code, I found that the TextBox in the DataGrid under the editing mode still holds the old value, and the value that I typed in seems to be lost somehow. Well, I thought it might be the ViewState issue, so I checked the ViewState […]

AJAX Tutorial

AJAX is becoming a hot topic in Web applications and it seems that every Web developer is talking about it or advocating it or criticizing it, or whatever. Some even refer it as “future of the Web”. What in the world is AJAX then? First of all, AJAX is NOT a language. Secondly, AJAX stands for Asynchronous JavaScript and XML. It is just a technique, actually an old technique called remote scripting which allows client-side […]