Login box popping up!

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

I am created a ASPX web app. I am using forms authentication and it seems
to be working well.

After logging in I am redirected to a form that is a "Secure" directory.
It's using data coming from a SQL Server db on the internet. Clicking on a
listbox item is supposed to populate the form with data. (It's doing a
postback.)

The first time the form loads it does it fine. But, when I click on a
listbox item (to have the form populated with a new set of data) I get a
Windows login window. Any ideas???

The window title is "Connect to DCQBMR99" which is my pc.

Thanks.
 
How does your Authentication WORK?
Becos it seems the page isn't authorised so u needed to Authenticate!!
Patrick
 
In a nutshell:

My normal web.config is setup like this:
<authentication mode="Forms">
<forms loginUrl="Login.aspx" name="sqlAuthCookie" timeout="60"
path="/">
</forms>
</authentication>
<authorization>
<allow users="*" /> <!-- Allow all users -->
</authorization>

The secured page is in a Secured dir. My complete web.config in this dir is
this:
<configuration>
<system.web>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
</system.web>
</configuration>

When I load up the page in the Secured dir it auto-redirects me to
Login.aspx (which is good). After the user types in a correct
userid/password I simple do a response.redirect to the ReturnUrl from the
QueryString.

The secured page initially loads with NO Windows login prompt. But on the
postback it prompts me.

Any ideas?

Thanks.
 
I fixed it. DO NOT USE RESPONSE.REDIRECT.

Use this:
System.Web.Security.FormsAuthentication.RedirectFromLoginPage(Me.txtUserName.Text,
True)

Duh.... me
 
Back
Top