Software development stuff.

2007-07-26

Try Catch in Sql Server 2005

Here's a good short text about error handling and transaction handling in Sql Server 2005 using Try Catch.

Etiquetas:

2007-07-19

Select a row in a GridView by clicking anywhere on the row

Here's how to select a row in a GridView by clicking anywhere on the row. On RowCreated you set
e.Row.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(
new PostBackOptions( GridView1, "Select$" + e.Row.RowIndex)));

I got some help from this post, even though he was looking for an answer to a different problem.

Etiquetas:

2007-07-16

RadioButtonList with and AJAX UpdatePanel and AsyncPostBackTrigger

When using the RadioButtonList with an AsyncPostBackTrigger I just had a server event on the first change. I was going slightly mad until I found this:
Mike Ormond's Blog : The Curious Case of the RadioButtonList not Triggering

Etiquetas:

LLBL, don't generate the date and time on the header of the files, for VSS

You may not want the date time generated onm every file if you use VSS, no need to check-in the file if nothing changed.
HnD::List all messages of thread: Is there any way to switch off the 'Code Generated On' comment in the Generated code?: "TdlEmitTimeDateInOutputFiles"

Etiquetas:

MS Ajax AutoComplete using a page method

Had to google to find this one. AJAX documentation doesn't tell all.
You nees to set the method as static if you want to use a page method instead of a web method.
MS Ajax AutoComplete Extender using a Page Method « All Wrong

Etiquetas:

2007-07-12

Register the onclick event for a Radiobuttonlist

If you need to set the onclick client event for each radio button in a Radiobuttonlist, it's not obvious.
This page was usefull for me, although it contains a solution for ASP.NET 1.
In ASP.NET 2 I ended up doing something similar but using Page.ClientScript and document.getElementsByName('<%rbl.UniqueID%>'); and then setting the onclick event dynamically.
You need to give a function reference to the event and inside the function you can use "this" to accerss the radio button properties.

Etiquetas:

2007-07-10

Recovering Deleted Files

I just had an unfortunate accident, while playing with the delte command of nant ended up deleting some important files! And it deletes them completely, not into the recycle bin...
I immeditely googled an found this: Recovering Deleted Files which was of great help, recovered all of the files except one, I guess I should have stopped using the computer imediately...

Etiquetas:

The difference between ResolveUrl and ResolveClientUrl

Ever wondered what is the difference between ResolveUrl and ResolveClientUrl?
I did:
"In simple terms, ResolveClientUrl returns a path relative to the current page, and ResolveUrl returns a path relative to the site root."
From Andornot Developers' Blog: ResolveUrl vs. ResolveClientUrl

Etiquetas:

2007-07-04

Focus in ASP.NET Controls

There are several ways to set the default focus on a asp.net control.
It was great to find out that it's enough to do a txtName.Focus();
See Focus in ASP.NET Controls

2007-07-03

Allowing special keys like F5 for onkeypressed evetn on firefox

Bumped into this problem where I was filtering the allowed keys in a input text with onkeypressed but then I noticed that the F5 wouldn't work neither when the focus was on the input.
Here's info about filtering the characters.
Here's info about allowing the F5 and special keys

Etiquetas: