ASP.NET

104 posts

Type special symbols in Visual Studio .NET text editor

Have you ever had this problem that you need to type some special symbols in Visual Studio .NET text editor? Such as ©, ®, ±, à, À, and the list goes on. Of course, if you are working on an ASPX file, you can always use the HTML editor and type in their HTML names or HTML numbers, and Visual Studio .NET will automatically convert them to those special symbols (VS 2005 does a much […]

Browser-safe color palette

One of the important tasks when working with Cascade Style Sheet is picking a good color for an item. I always like to assign a color value with the hexadecimal form, but the problem is I can’t memorize those hexadecimal values. Visual Studio .NET IDE has very good intellisense support for creating/editing CSS files, but it only support named colors. What I need is some color palette on-line like this to help my pick a […]

Fighting against spammers: my experiences

Started from June this year, I began to receive about 20 application error notifications every day via email from our church’s web site, which I have developed and have been maintaining ever since, indicating that “A potentially dangerous Request.Form value was detected from the client (txtAddress=”. Like many other applications involving membership, there is a registration form for church members to register so as to receive member-only services, such as receiving devotionals/newsletters via email, receiving […]

AJAX Drop Down List – Part Three

In the part one and part two of AJAX Drop Down List tutorial, I have described how to populate a drop down list with plain string data and XML string data respectively. If you followed the first two parts of the tutorial and built your drop down list, you will probably notice that you cannot use “ddlChildList.SelectedValue” to retrieve the value from the drop down list. The reason is that the drop down list is […]

AJAX Drop Down List – Part Two

In the part one of AJAX Drop Down List tutorial, I described how to popuate a child drop down list with plain string data. In this post, I will describe how to use XML data to populate the child drop down list. There are not gonna be many changes, so I will just address those need to be changed. 1. Client Side Page – ProductList.aspx There is no chnage except the JavaScript code, I will […]

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 […]

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 […]