Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp.net webforms + jquery = can't get button press

wanted to include jquery in masterpage, but as soon as I did that - my login page stopped working... in chrome console I'm getting:

uncaught TypeError: Cannot read property 'onsubmit' of null

from stack I can see that it is here:

Sys.WebForms.PageRequestManager._initialize('ctl00$ScriptManager1', document.getElementById('aspnetForm'));

in firefox:

this._form is null
this._onsubmit = this._form.onsubmit; 

and that error is in ScriptResource.axd?=...

and this causes that I can't just click on the Login button - it does nothing... on the other hand - everything works in Opera... even better - if I am to remove:

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.5.min.js" type="text/javascript" />      

then everything works fine (tried also other versions of jquery)... now the best is that other pages - that also have buttons and events, work... I've even changed the login page not to use Login control... and it still doesn't work... I'm really confused right now...

like image 264
argh Avatar asked Dec 21 '22 18:12

argh


1 Answers

My colleague found a solution by an accident... if you change:

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.5.min.js" type="text/javascript" /> 

to

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.5.min.js" type="text/javascript"></script>

it magically starts to work... now... this should be xhtml... can anyone explain to me WHY there is a difference here?!

like image 105
argh Avatar answered Jan 01 '23 12:01

argh