@tapang1987 thanks for the link. My video's focus is to understand client callbacks and sending email has been used more to understand the functionality of client callbacks, rather than to learn sending email from ASP.NET.
Therefore, you must use Page_IsValid on client side in the function that is being called - in this case the function is being called on the onclick client event. Therefore, goto that function and use
You can validate controls client side with callbacks using Page_IsValid method before sending data to server. So, for the function which you are calling in the onclick event, enclose that function in
if(Page_IsValid) {
//function code
}
The reason is callback is not following the normal page processing and since it is client callback, they are executing together. You have to use IsValid on clientside (server side would not work because page has already started client callback processing)
Usually validation controls perform client side first, and then only perform on server side when necessary. Like for example, the browser unable to support client side scripts. What exactly is the scenario where you are having problems with validation? Client Callback only comes into play when data is sent to server - and data is only sent once verified by validation controls. So let me know the exact problem and I can try to help you out.
one more thing i forgot to mention that i also tried cause validation of button to true and also used page.isvalid in code behind but was facing same problem, that showing invalid email message and also executing the code..
excelent video... thanx. but i am facing problem using regular expression validator when using client callback, hope you add some videos regarding callback and input validation... thanx
check out this video of sending email in simple steps.
watch?v=_LIOVsNq5fE
tapang1987 1 year ago
@tapang1987 thanks for the link. My video's focus is to understand client callbacks and sending email has been used more to understand the functionality of client callbacks, rather than to learn sending email from ASP.NET.
rafaybinali 1 year ago
Therefore, you must use Page_IsValid on client side in the function that is being called - in this case the function is being called on the onclick client event. Therefore, goto that function and use
if(Page_IsValid) {
//code
}
rafaybinali 2 years ago
You can validate controls client side with callbacks using Page_IsValid method before sending data to server. So, for the function which you are calling in the onclick event, enclose that function in
if(Page_IsValid) {
//function code
}
The reason is callback is not following the normal page processing and since it is client callback, they are executing together. You have to use IsValid on clientside (server side would not work because page has already started client callback processing)
rafaybinali 2 years ago
Usually validation controls perform client side first, and then only perform on server side when necessary. Like for example, the browser unable to support client side scripts. What exactly is the scenario where you are having problems with validation? Client Callback only comes into play when data is sent to server - and data is only sent once verified by validation controls. So let me know the exact problem and I can try to help you out.
rafaybinali 2 years ago
What exactly are you trying to do AND what is the error message?
rafaybinali 2 years ago
one more thing i forgot to mention that i also tried cause validation of button to true and also used page.isvalid in code behind but was facing same problem, that showing invalid email message and also executing the code..
RahulTheDeveloper 2 years ago
excelent video... thanx. but i am facing problem using regular expression validator when using client callback, hope you add some videos regarding callback and input validation... thanx
RahulTheDeveloper 2 years ago