Exception: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
6/28/2014 3:10:37 PM
Gravatar
Total Posts 18

Exception: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'

Hi,

I just pulled down the latest default branch (rev 5653) using TortoiseHg.and after building, I tried to open the blog and got the following exception:

WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'

[InvalidOperationException: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).] System.Web.UI.ClientScriptManager.EnsureJqueryRegistered() +2178762 System.Web.UI.WebControls.BaseValidator.RegisterUnobtrusiveScript() +10

It's been a few weeks since I've downloaded the code and built, but the previous version of code I had was working fine. Hopefully, this is a simple fix.

Thanks!

 

6/29/2014 2:05:58 AM
Gravatar
Total Posts 128

Re: Exception: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'

I don't see that problem on mine (just pulled).

However I do get an error on creating or editing a blog post, logged under a new thread.

6/29/2014 10:39:08 AM
Gravatar
Total Posts 18

Re: Exception: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'

After some investigation, I saw where the UnobtrusiveValidationMode entry had been added to web.config since my last pull a few weeks ago. According to stack overflow and msdn forums, the way to get around this is to remove the entry, or set the value to None, or register the version of jquery that you are using.

I also found a problem with the projects themselves. I'm still using Visual Studio 2010 and noticed that 3 of the projects including mojoPortal.Web were listed as being incompatible with the version of Visual Studio that I'm using so they couldn't be loaded.

I'm also still on .Net 4.0 and was about to upgrade to .Net 4.5 but saw where it isn't compatible with VS 2010.

I saw in the notes for revision 5634 that a new solution had been created to target .Net 4.0 (mojoportal.net40.sln) and that the main projects were changed to target .Net 4.5. When I switched to using that new solution, that fixed my problem. I didn't have to make any other changes and the problem with the UnobtrusiveValidationMode error went away. So, I'll need to keep using that solution until I upgrade .Net and Visual Studio.

On a side note, I had actually reverted back to revision 5633, which still targeted .Net 4.0, and that worked as well but using the new .Net 4.0 solution is the better way to go.

 

6/29/2014 2:01:36 PM
Gravatar
Total Posts 18439

Re: Exception: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'

Hi,

I should have mentioned that since we did change our target to .NET 4.5, to use .NET 4 you have to use a different web.config so you would have to copy the contents of the Web.net40.config file into Web.config to avoid errors working in VS. This is the same as when someone wants to use .NET 3.5, they have to use the Web.net35.config contents. The default Web.config is now targeting .NET 4.5.

I guess in addition to turning the corner on our target framework we are apparently turning the corner on VS support and 2010 probably isn't going to cut it going forward. You might be able to use the Express version of VS 2013 Update 2.

Best,

Joe

6/29/2014 2:59:17 PM
Gravatar
Total Posts 18

Re: Exception: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'

Thanks for the update, Joe.

As it turns out, I am running with .Net 4.5 (according to the  Visual Studio About dialog) but I still can't target .Net 4.5 applications. That makes sense since I read that .Net 4.5 is meant as a direct drop-in replacement for .Net 4.0. I guess this is why I'm still able to use the web.config that is now targeting .Net 4.5. That won't last long though as .Net 4.5 features are added to mojoPortal which will then cause the build to break.

Yea, I need to get a new machine along with a new version of Visual Studio.

Thanks again.

 

You must sign in to post in the forums. This thread is closed to new posts.