views:

108

answers:

1

Hi all,

When using a gridview and not logged into a asp.net website, the java scrpit does not appear to work. If I am logged in as a user, any pages with gridviews work fine. The only error I'm getting when checking the javascript with Firebug is 'ReferenceError: DES_ValOnSubmit is not defined.' This is a reference to a Peter Blum javascript function, but have no idea why it would fail for anonymous users, and it does for logged in users.

Thanks for any help.

+4  A: 

I'm not sure what your authentication scheme might be, but if you are using the authorization tags in the web.config file, you might need to make an explicit exception for your javascript if you are denying the anonymous user to sections of your web site. Something like this:

<location path="MyScriptFolder/MyPeterBlumJS.js">
    <system.web>
        <authorization>
            <allow users="*" />
        </authorization>
    </system.web>
</location>

You can also just set the path to "MyScriptFolder" to allow all users access to your javascript as needed.

Matt Hamsmith
Brilliant, that was the problem. Needed to give an authentication exception to the DES folder and the problem was solved.
Davoink
I'm happy to help.
Matt Hamsmith