D
David
I have an asp.net page (version 3.5) with some straightforward stuff on it.
For example, I have a formview object that is linked to a sqldatasource. One
of the items is a textbox in which a user is supposed to enter a date. That
date is bound to a field, and when the user hits the "insert" button at the
bottom, a new entry is created.
It works great, unless the string entered into the textbox isn't really a
valid date. Then there is a problem. Not surprisingly, it throws an
exception.
What I want to know is where I can catch that exception. Where do I put the
code that catches the exception and forces the user to go back and put in a
correct date before the new record is created?
For example, I have a formview object that is linked to a sqldatasource. One
of the items is a textbox in which a user is supposed to enter a date. That
date is bound to a field, and when the user hits the "insert" button at the
bottom, a new entry is created.
It works great, unless the string entered into the textbox isn't really a
valid date. Then there is a problem. Not surprisingly, it throws an
exception.
What I want to know is where I can catch that exception. Where do I put the
code that catches the exception and forces the user to go back and put in a
correct date before the new record is created?