Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 212 Vote(s) - 3.64 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Curious about removing parentheses in CustomValidator's ClientValidationFunction property?

#1
I'm a beginner in asp.net. I tried the `CustomValidator` and put `my_fun()` Javascript function into the `ClientValidationFunction` property. I get that error :

> Microsoft JScript runtime error: Object expected


But when i remove the parentheses i get no errors at all.

Why does that happen ?
Reply

#2
I think what's happening is: when you put the name of the function without parentheses, you are putting in a reference to a function *object*. You are indicating which function should be called.

When you put in the function name with parentheses, you are *calling* the function. You are indicating that the function to be called should be the *result* of the function specified.

If your function doesn't return anything, the code that attempts to call the validation function will have nothing to call, and there will be an error.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through