Rob Meade ha scritto:
...
Hey,
You didn't mention whether this was going to be client or server side, but
something along these lines...
If txtMyTextBox.Text = String.Empty Then
txtMyTextBox.Text = "0"
End If
Thank you Rob, I have to do that server side, but I can't do like your
example as I use a formview control bounded to an objectdatasource.
So when I have some textboxes with no values, and the property of my
object is Int, it generates an error.
I tried to intercept some event like OnInserting, but in the code I
can't reach the textboxes of the ItemTemplate.
For this reason I want prevent the problem by validating the textboxes,
but in case of null how can I put a "0" ? I read somewhere that regular
expressions can also substitute values but wasn't teached how...