understanding error message

  • Thread starter Thread starter Leon Shaw
  • Start date Start date
L

Leon Shaw

Someone please help me understand the following error message:

Server Error in '/solo' Application.
----------------------------------------------------------------------------
----

Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application
in IIS.

Source Error:

Line 23: "Forms", "Passport" and "None"
Line 24: -->
Line 25: <authentication mode="Forms" />
Line 26: <forms name="uloginCookie" loginUrl="login.aspx">
Line 27:

Source File: c:\inetpub\wwwroot\solo\ulogin\web.config Line: 25
 
Leon,

It looks like the folder your .net files are in is not configured as a web
application on the server.

On the server go to:

Administrative Tools - Internet Information Services

Expand the computer node, expand the web sites node, and find your web site
in the list (It may be within the "Default Web Site" node depending on how
your machine is set up.) If the web site's icon is a folder it is not
configured as a web site.

To configure it as a web site, right click on it and choose properties.
Click the create button and then everything should be fine.

If you have added a web.config file to a folder within your main website
then that folder needs to be a website itself in order for web.config to
function properly.

I hope this helps.

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Yes, it usually does. But there are some circumstances in which it does not.
If you add a web.config file to a folder it doesn't automatically make that
folder an app. Another example would be if you copy and paste the web site
files into a folder on the server. Then you would have to set up the site
yourself.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
ok so if I added a folder named ulogin to my application in which all my
protected webpage and web.config file is located then ulogin folder itself
must be a web application. So how do I add an application (instead of a
folder) to my main web application inside of VS.net IDE, so I can password
protect certain pages?
 
Leon,

If you want instead of adding a separate web.config file to your folder you
can actually use the main web.config file to protect a folder within the web
site.

I have an example on how to do this on my website: www.aboutfortunate.com.
Just search the code library for: "protect a folder with forms
authentication"

I also have a link to an article about how to use a database with forms
authentication in the library (I just added the link when I saw it posted
here).

Good luck!

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Leon,

Here's how I'm doing it:

'---My login page code
Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLogin.Click
Try
Dim FormsAuth As New FormsAuthentication
If FormsAuth.Authenticate(txtbxUsername.Text.ToString,
txtbxPassword.Text.ToString) Then
FormsAuth.RedirectFromLoginPage(txtbxUsername.Text.ToString,
True)End If
Catch ex As Excepion
'---Handle errors
End Try
End Sub

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
but what if you wanted to send the user back to a specified pade(not
RedirectFromLoginPage) which is the default.aspx?
 
Leon,

..Net handles that for you. It sends the user to the original page they were
trying to go to when they were redirected to the login page.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Back
Top