Link to home
Start Free TrialLog in
Avatar of Ashley Bryant
Ashley BryantFlag for United States of America

asked on

ASP.NET: Forms Authentication and javascript

Let's see if someone can explain this goofiness.  I'm using Forms Authentication in ASP.NET (VB.NET) to handle my site logins.  This works great.  However, when the users are redirected to the page they were requesting before login there is an error in the javascript that loads up the site navigation menu.  The error, of course, prevents the menu from loading at all.  Here's where it gets goofy.  If I log out and then log back in without closing the browser, the menu loads up just fine.  The menu I'm using is HV Menu from dynamic drive.

http://www.dynamicdrive.com/dynamicindex1/hvmenu/

Any ideas on this one fellas?  I'm prettymuch stumped.  
Avatar of farkit
farkit

Do you have a live version we can try?

Are your Navigation Menu related file under the directory that hold the pages requiring login?
What JavaScript error are you getting?
Avatar of Ashley Bryant

ASKER

Unfortunately it's a government site that's not accessible by the outside world.  I'm not at work right now, but the errors were popping up for the menu_com.js file when it calles the BeforeStart function (assuming you've downloaded and looked at HV Menu code).

Interesting item:  I changed the FormsAuthentication.RedirectFromLoginPage persist cookie property to true and after the first time a user logs in the javascript error doesn't pop up anymore, even if they reopen their browser and start a new session.  Pretty weird that that would prevent the error.

I'm heading out of town for three weeks (Hawaii, woot!) so I'll take a look at this more when I get back.

Thanks,

Ash
I ended up scrapping the javascript driven menu and using a CSS built <ul> menu instead.  Way WAY faster and no need to load any external files.  Requesting that the question be closed.

Thanks,

Ash
ASKER CERTIFIED SOLUTION
Avatar of PAQ_Man
PAQ_Man
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<location path="Scripts">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>

For me the above helpmed me solve it - just replace "Scripts" with your respective folder. Add these tags just above the </configuration> tag.