GridView control has several new fields to give user more control over the GridView’s format, for example, the HyperLinkField is one of them which enable user to easily format the hyper link in a GridView control. But what if you are using a server control that does not support HyperLinkField, such as DataList, Repeater? How can you format the HyperLink’s NavigateUrl in the designer that is bound to a datatable? The answer is to use […]
When you run a SELECT query in your ASP.NET code to fill a DataSet, you may encounter this error: IErrorInfo.GetDescription Failed with E_FAIL(0x80004005) This error is usually caused by the fact that the table name or some column name happens to be a keyword, such as “name”, “first”, and “date”, etc. If it is the case, then use square brackets around those column names as [name], [first], and [date], and it should fix the error.
How can you disable the “X” button on a Windows Form so that user has to click a Close button on the form to close the window? You may say just set ControlBox=False for the Form. But it will hide all the buttons, including the minimize and the maximize button. What if you still want user to be able to minimize/maximize the window? Jose Luis Manners described a very simple but slick way to accomplish […]
When I tried to install IIS on my laptop which is running Windows XP Pro SP2, I got this error during the installtion: “Copy error Setup cannot copy the file staxmem.dl_. Ensure that the disk labeled ‘Windows XP Professional Service pack 2 CD’ is in the drive selected below, or provide the location where the file can be found.” After some search on the Internet, it turned out it is a very common error that […]
When launching a web application, an error like this shows up: 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. There are several causes for this error: 1. Just like the error says, the virtual directory in IIS is not an application folder. To fix, just go to IIS and expand “Default Website” […]
A very handy tip I got via email from Microsoft. On a blank line in a Microsoft Office Word document, type =rand followed by (PC,SC)—where PC stands for paragraph count and SC stands for sentence count—and then press ENTER. For example, =rand(2,3) will create two paragraphs of three sentences each. Word inserts some random text based on your specification. You can use this new text for testing form controls such as text boxes or paragraph […]
I came across this old YouTube video and it cracked me up.
Tooltip is a very nice feature in ASP.NET for displaying additional information when hovering mouse over an item, but the problem with tooltip is that it will go away after about 2 seconds and you will have to move your mouse away and move back to make it appear again. You don’t have any option to change the duration of the display either. It really irritates me for not being able to keep the tooltip […]
GridView or DataGrid only allows you to delete one row each time and it becomes inefficient and tedious if there are multiple rows need to be deleted. In this post, I will demo how to add a check box in front of each row and also a check box in the header of the grid to check/uncheck all check boxes, then with a delete button to delete those checked rows in a batch mode. I […]
This has been used a lot on those “sign up” forms. User has to select a check box indicating “I read and agree to the license agreement”, or something like that, before he/she can submit the form. Of course, with ASP.NET, you can let user submit the form and then check the state of the check box in the Button.Click event handler to prompt the user if the check bos is not checked. But my […]