re:
!I haven't been asked about any conversions. I simply opened VWD2008 Express
!and opened the SLN-file containing the solution i've been working in VS2005.
!It just got opened and the only nag i got was one for converting the line breaks to Windows format.
That's really odd.
Everytime I create a project in VS 2005 and later open
the .sln file with VWD, the conversion wizard runs.
re:
!As far i could see, there was no "section" tags in my web.config file.
There wouldn't be. Those sections go into the machine.config file.
What I asked you was to check whether you web.config contained references to those objects.
re:
!The line i'm directed to when clicking on the error description says:
!<authenticatio n mode="Forms">
Yes, that's the reference to <section name="authentic ation".
What authentication code do you have in your app ?
Do you have a logon page which requests credentials from your users ?
Here's a complete example to test the authentication capability you seem to be missing:
Could you create a new project in VWD, copy the 3 files
I included in web.zip into the new project and run *default.aspx*
by right-clicking it in the Solution Explorer and selecting "View in Browser" ?
....and then post back the results of your test ?
You should get prompted for authentication.
Use "tm**@vilterste n.com" for both the username and the password.
You should first be sent to login.aspx and then, after inputting the credentials above,
be redirected to login.aspx where the username "tm**@vilterste n.com" will be displayed.
In case you can't download zip files, here's the text of the files :
web.config:
-----------------
<?xml version="1.0"?>
<configuratio n>
<appSettings/>
<connectionStri ngs/>
<system.web>
<compilation debug="true" strict="false" explicit="true" >
</compilation>
<pages>
<namespaces>
<clear/>
<add namespace="Syst em"/>
<add namespace="Syst em.Collections"/>
<add namespace="Syst em.Collections. Specialized"/>
<add namespace="Syst em.Configuratio n"/>
<add namespace="Syst em.Text"/>
<add namespace="Syst em.Text.Regular Expressions"/>
<add namespace="Syst em.Web"/>
<add namespace="Syst em.Web.Caching"/>
<add namespace="Syst em.Web.SessionS tate"/>
<add namespace="Syst em.Web.Security "/>
<add namespace="Syst em.Web.Profile"/>
<add namespace="Syst em.Web.UI"/>
<add namespace="Syst em.Web.UI.WebCo ntrols"/>
<add namespace="Syst em.Web.UI.WebCo ntrols.WebParts "/>
<add namespace="Syst em.Web.UI.HtmlC ontrols"/>
</namespaces>
</pages>
<!--
The <authentication section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authenticati on mode="Forms">
<forms loginUrl="login .aspx" name=".ASPXFORM SAUTH">
</forms>
</authentication>
<authorizatio n>
<deny users="?"/>
</authorization>
</system.web>
<system.codedom >
</system.codedom>
<system.webServ er>
</system.webServe r>
</configuration>
-----------------------
default.aspx:
------------------
<%@ Page Language="VB" %>
<html>
<head>
<title>Forms Authentication - Default Page</title>
</head>
<script runat="server">
Sub Page_Load(ByVal Src As Object, ByVal e As EventArgs)
Welcome.Text = "Hello, " & Context.User.Id entity.Name
End Sub
Sub Signout_Click(B yVal sender As Object, ByVal e As EventArgs)
FormsAuthentica tion.SignOut()
Response.Redire ct("Login.aspx" )
End Sub
</script>
<body>
<h3>
Using Forms Authentication</h3>
<asp:Label ID="Welcome" runat="server" />
<form id="Form1" runat="server">
<asp:Button ID="Submit1" OnClick="Signou t_Click"
Text="Sign Out" runat="server" /><p>
</form>
</body>
</html>
------------
login.aspx:
-----------------
<%@ Page Language="VB" %>
<%@ Import Namespace="Syst em.Web.Security " %>
<script runat="server">
Sub Logon_Click(ByV al sender As Object, ByVal e As EventArgs)
If ((UserEmail.Tex t = "tm**@vilterste n.com") And _
(UserPass.Text = "tm**@vilterste n.com")) Then
FormsAuthentica tion.RedirectFr omLoginPage _
(UserEmail.Text , Persist.Checked )
Else
Msg.Text = "Invalid credentials. Please try again."
End If
End Sub
</script>
<html>
<head id="Head1" runat="server">
<title>Forms Authentication - Login</title>
</head>
<body>
<form id="form1" runat="server">
<h3>
Logon Page</h3>
<table>
<tr>
<td>
E-mail address:</td>
<td>
<asp:TextBox ID="UserEmail" runat="server" /></td>
<td>
<asp:RequiredFi eldValidator ID="RequiredFie ldValidator1"
ControlToValida te="UserEmail"
Display="Dynami c"
ErrorMessage="C annot be empty."
runat="server" />
</td>
</tr>
<tr>
<td>
Password:</td>
<td>
<asp:TextBox ID="UserPass" TextMode="Passw ord"
runat="server" />
</td>
<td>
<asp:RequiredFi eldValidator ID="RequiredFie ldValidator2"
ControlToValida te="UserPass"
ErrorMessage="C annot be empty."
runat="server" />
</td>
</tr>
<tr>
<td>
Remember me?</td>
<td>
<asp:CheckBox ID="Persist" runat="server" /></td>
</tr>
</table>
<asp:Button ID="Submit1" OnClick="Logon_ Click" Text="Log On" runat="server" />
<p>
<asp:Label ID="Msg" ForeColor="red" runat="server" />
</p>
</form>
</body>
</html>
-----------
Running those 2 pages with the web.config will tell you if
the problem is with VWD...or with your authentication code.
Please post back the results of the test, OK ?
Juan T. Llibre, asp.net MVP
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
=============== =============== ========
"K Viltersten" <tm**@vilterste n.comwrote in message news:op******** *******@lp028.p agero.local...
!when i try to run index.aspx, i get error message as follows:
!Error 95 It is an error to use a section registered as
!allowDefinitio n='MachineToApp lication' beyond application level.
Did you convert the project when you first opened it inVWD 2008?
I haven't been asked about any conversions. I simply opened
VWD2008 Express and opened the SLN-file containig the
solution i've been working in VS2005. It just got opened
and the only nag i got was one for converting the line breaks
to Windows format.
re:
!It's also suggested that it might be due to that the directory isn't
!configured as an application in the IIS. What can be done to resolve
it?
I suggest you check the specific setting which is causing theproblem in
your web.config.
There's not too many of them:
<section name="anonymous Identification"
<section name="authentic ation"
<section name="healthMon itoring"
<section name="hostingEn vironment"
<section name="machineKe y"
<section name="membershi p"
<section name="profile"
<section name="roleManag er"
<section name="securityP olicy"
<section name="sessionSt ate"
<section name="siteMap"
<section name="trust"
<section name="urlMappin gs"
<section name="cache"
<section name="outputCac he"
<section name="outputCac heSettings"
<section name="sqlCacheD ependency"
As far i could see, there was no "section" tags in my web.config
file. The line i'm directed to when clicking on the error
description says:
<system.web>
<customErrors defaultRedirect ="Error.aspx " mode="RemoteOnl y"/>
BELOW IS THE LINE
<authenticati on mode="Forms">
ABOVE IS THE LINE
<forms timeout="10000"/>
</authentication>
<compilation debug="true">
<assemblies>
<add assembly="Syste m.DirectoryServ ices, Version=2.0.0.0 , Culture=neutral ,
PublicKeyToken= B03F5F7F11D50A3 A"/>
</assemblies>
</compilation>
</system.web>
--
Regards
Konrad Viltersten