Home > Archive > ASP .NET > August 2005 > validator not working when page is served from a different machine
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
validator not working when page is served from a different machine
|
|
|
| I have a page with a required field validator and it is working fine.
We put this project on another developer's machine and the validators
do not work. We get a javascript error that says 'Invalid Character
at line 24' but that line is not even javaScript.
This project is in sourceSafe and we both have done 'get latest
version' so I know the code is the same. This is not a browser
config issue because if I browse to his machine the valdiator does not
work and if he browses to my machine they do work.
I've noticed that the onsubmit property of the form tag is different
when my machine serves then page than it is when the page is served by
his machine. Below are the onsubmit properties:
Good onsubmit:
"if (!ValidatorOnSubmit()) return false;"
Bad onsubmit:
"ValidatorOnSubmit();"
Why would the same code generate different HTML?
Don
| |
| Andrea Zani 2005-08-30, 7:01 pm |
| Don <chambersdon@hotmail.com> ha scritto:
> I have a page with a required field validator and it is working fine.
> We put this project on another developer's machine and the validators
> do not work. We get a javascript error that says 'Invalid Character
> at line 24' but that line is not even javaScript.
If machina is Win 2003, install Framework Service Pack 1 for win 2003.
--
AZ [Microsoft - .NET MVP]
Mia Home page: http://ciclismo.sitiasp.it
Asp.Net community: http://www.aspitalia.com
Il mio blog: http://blogs.aspitalia.com/az
| |
|
| I have a problem that is not very similar to yours but is close. Here goes:
my PC is Windows XP pro.sp2. IE6.x (lattest), pn certain websites such as
http://dictionary.com, when I enter a word that it does not know, a message
says:
<<<
A Runtime error has occurred. Do you wish to debug ?
Line: 1
Error: Syntax error[color=darkred]
But then I went to other PC and attempted the samething, it works fine. So I
rebuilt by PC, it ran for a while and the same thing happenned again ! Very
weird!
*** I then tried to view the source code of the page, sometimes I could view
it in NotePad, othertimes (on the same website), the "view source" menu itm
is grayed out. When I could view the source, I saw nothing wrong with Line 1
and or I donot know where "Line: 1" is to begin with. Windows does have its
own mind ! I quit debugging it.
John
| |
|
| The machine is XP. I see that I have a hotfix (KB886904) and the other
machine does not. I'm going to try to find this hotfix and install it
on the other machine. Is the service pack 1?
| |
| John Rivers 2005-08-31, 7:56 am |
|
this is the sort of problem
that is likely to arise when
using a badly designed platform
such as asp.net's htmlcontrols, usercontrols, servercontrols
if you continue to use these controls
your job will contain many unhappy hours of debugging and
reverse engineering, just to achieve a lesser result
my recommendation is to avoid them and implement such
features yourself
you will gain:
- predictability
- save time learning arbitrary technology with doubtful value
- ability to fix your code (you can't rewrite broken microsoft stuff,
you have to wait for them to fix it)
- protection from future "updates" that break your apps
would you trust a third party component to generate javascript on the
fly?
of course not! so why trust these controls?
top end websites do not use *these features* of asp.net - they just use
the good bits
the fact that you need to install a hotfix proves my point perfectly -
ms first attempt was
flawed - hardly surprising they have bitten off more than they can
chew!
|
|
|
|
|