Reputation: 193
In my ASP.Net web application, there is a textbox to receive ProductId. When the user enters data into the ProductId textbox and moves to the next textbox, I want to validate the data against a table and if matching record is found, I want to display Product details in different controls (readonly and normal textboxes) else I want to display a message about "New Product" and continue. I do not want to do the verification AFTER the user enters all data and press the Save button, but it should be done immediately. I was hoping that the Web Form textbox would have a LostFocus event, but do not know how to handle the requirement.
Upvotes: 0
Views: 5175
Reputation: 6805
It's easy solution, read this article:
You just need to preform javascript call to trigger server validation, use event onlostfocus.
Upvotes: 0
Reputation: 7412
ASP.NET Validators don't have an ajax style immediate check.
This site : http://brian.dobberteen.com/code/jquery_ajax_custom_validator/ will help you with a lot of it, but one thing is this will fire only when the page is submitted. You'll want to hook up an additional event handler to your textbox to call the validation method on focusout
Upvotes: 1