Error messages with Validators

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

I have a problem where I have some text boxes in my datagrid.

The problem is the message gets displayed and moves the cells to the right.

Is there a way to tell the messages to go to a specific asp:label? If I
could put the label at the bottom of the page (or top) and tell the
Validator to put it there that would solve the problem.

I suppose I could use the CustomValidator for my ranges, but I was wondering
if there was a different way to handle this.

Thanks,

Tom
 
Why dont you use Validation Summary control to display all the error
messages. This way you ensure that messages are displayed in the summary
control., which you can position where ever you want, possibly at the top of
the page
 
Kumar Reddi said:
Why dont you use Validation Summary control to display all the error
messages. This way you ensure that messages are displayed in the summary
control., which you can position where ever you want, possibly at the top of
the page

I'll check that out. I didn't know about that or how it works. Will check
it out tomorrow.

thanks,

Tom
 
tshad said:
I have a problem where I have some text boxes in my datagrid.

The problem is the message gets displayed and moves the cells to the right.

Is there a way to tell the messages to go to a specific asp:label? If I
could put the label at the bottom of the page (or top) and tell the
Validator to put it there that would solve the problem.

I suppose I could use the CustomValidator for my ranges, but I was wondering
if there was a different way to handle this.

Thanks,

Tom

The validator doesn't need to be right next to the textbox it is
validating, you can put it anywhere on the page. The link between
textbox and validator is via ControlToValidate.
(and, as others said, look into ValidationSummary)
 
Hans Kesting said:
The validator doesn't need to be right next to the textbox it is
validating, you can put it anywhere on the page. The link between
textbox and validator is via ControlToValidate.
(and, as others said, look into ValidationSummary)

You're right. I hadn't thought of that. I am going to look at both
options.

Thanks,

Tom
 
Back
Top