script and buttons not working in v.1.4.5

Topics: Controls
Feb 15, 2009 at 8:27 PM
I'm running version 1.4.5 on IIS 7
but am having problems getting the widgets and e.g. search button to work
once I click them I get the error: "Object expected"

Login and other functionality seens to work fine..
Anyone else come across these problems?

I've modified the web.config according to:
http://www.codeplex.com/blogengine/Thread/View.aspx?ThreadId=42541
Coordinator
Feb 15, 2009 at 10:51 PM
"Object expected" is a JavaScript error?  It's possible the BE JavaScript file isn't loading correctly.  If you do a View Source of your page, you'll probably find a script tag that looks similar to:

<script type="text/javascript" src="/js.axd?path=%2fbe145%2fblog.js&amp;v=1.4.5.0"></script>

The BE JavaScript file is loaded via the "js.axd" JavaScript handler.  js.axd is one of the handlers defined in the web.config file.  If it's not working (or setup) right, then the necessary JavaScript file may not be loading.  You can try accessing the js.axd handler directly.  The url to go to in your browser to test js.axd based on the above <script> tag would be:

http://www.website.com/js.axd?path=%2fbe145%2fblog.js&amp;v=1.4.5.0

If your blog is installed in a subfolder, you'd need to add the subfolder into the url above.  If it works, then you should see a bunch of JavaScript in your browser.  If it doesn't work, then you'll get some error message that can be used to help diagnose the problem further.
Feb 16, 2009 at 12:08 AM
Edited Feb 16, 2009 at 12:10 AM
** nvm, you tried that. Go with what Ben says :)

Hi Code, make sure you have this httphandler line in your web.config under the System.webserver section


I think it is missing by default, or was for me at one point.

<add name="js.axd_" path="js.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.JavaScriptHandler" preCondition="integratedMode,runtimeVersionv2.0" />
Feb 16, 2009 at 8:05 PM
Hi,
I tried accessing the js.axd file directly
http://www.localhost:81/js.axd?path=%2fbe145%2fblog.js&amp;v=1.4.5.0

but got an error 404, file not found.. fair enough! that explains why the script was not working :)
Then I added :
<add name="js.axd_" path="js.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.JavaScriptHandler" preCondition="integratedMode,runtimeVersionv2.0" />
to my web.config, and it solved the problem :)

Thnx :)