Last post May 22, 2012 07:32 AM by chumble
Nov 22, 2011 12:07 PM|Timmy TCC|LINK
The title pretty much explains it. I have the toolscriptmanager on my master page like so:
<ajaxToolkit:ToolkitScriptManager runat="server" />
and in my web.config I have the name declared, like so:
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
Microsoft JScript runtime error: Sys.ArgumentException: An element with id 'form1' could not be found.
Parameter name: elementOrElementId
... followed by
Microsoft JScript runtime error: Unable to set value of the property 'value': object is null or undefined
I had recently moved all my code manually from one project to another, where everything went smoothly and worked fine but I have only just now noticed this error. I have since ripped out all the ajax, redownloaded the latest version using nuget and put
it all back into my project. The problem is still there. Does anyone know what might be going on? I can show you the lines of script that are causing this error as well if you like.
*edit* the script manager is directly inside the form tag with id "form1" as is standard (in a master page).
Nov 22, 2011 12:30 PM|RanjeetAulakh|LINK
Nov 22, 2011 12:50 PM|Timmy TCC|LINK
Hi Ranjeet, thanks for your response.
On doing a view source i can see there is only one "form1". I'm confused. Not even sure how else to troubleshoot this...
Nov 22, 2011 01:27 PM|Timmy TCC|LINK
I have it fixed. This is rather ridiculous, you'll love it!
When putting a script file into a page, make sure it is <script></script> and not <script />! Not only did this stop all my postbacks working, it also wrecked the VS 2010 designer AND caused ajax control toolkit to throw a load of errors on page load.
Is my understanding incorrect, but shouldn't <script /> be acceptable?
Jan 10, 2012 04:35 PM|JulieMcFadden|LINK
Thank you. I actually signed up just to thank you for this. This little error had been bugging me for quite some time - especially in debug mode. (pun intended)
So, Timmy, thanks, and I agree - <script /> should be acceptable - but I'm sure they'll address it when they have time.
Feb 10, 2012 01:50 PM|Faisal5055|LINK
Thanks bro .. I was fighting this issue for hours
May 07, 2012 02:10 PM|katachthonios|LINK
This was totally was killing me, thanks for posting the answer once you figured it out.
May 22, 2012 07:32 AM|chumble|LINK
So.. thank you again.... 'awesome' as they say!