Men den gør at hele sitet er afhængig af at der skal logges ind. Hvis sitet f.eks. hedder www.siden.dk vil jeg gerne have at der kun skal logges ind når man forsøger at skrive www.siden.dk/cms.
det begrænses i web.config filen. Som standard er den vidst sat til alle:
Hvis du tilføjer dette til din web.config: <location path="cms"> <system.web> <authorization> <deny users="?" /> </authorization> </system.web> </location>
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.
Hvis der ikke er blevet logget ind vil jeg gerne have den til at redirecte til en side der hedder login.aspx.
Når jeg laver en location path som du beskriver får jeg en fejl om at den ikke kan finde mine references. Hvis jeg så kopierer biblioteket "bin" ind under cms. Virker det fint. Er det nødvendigt at have det bibliotek 2 steder?
Jeg arbejder i vs.net og bin biblioteket er mine "references". I references ligger bl.a. ByteFX.MySqlClient og URLRewriter.
Jeg har 2 system.web og de ser således ud:
<system.web> <httpModules> <add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter" /> </httpModules> <!-- DYNAMIC DEBUG COMPILATION Set compilation debug="true" to enable ASPX debugging. Otherwise, setting this value to false will improve runtime performance of this application. Set compilation debug="true" to insert debugging symbols (.pdb information) into the compiled page. Because this creates a larger file that executes more slowly, you should set this value to true only when debugging and to false at all other times. For more information, refer to the documentation about debugging ASP.NET files. --> <compilation defaultLanguage="c#" debug="true" /> <!-- CUSTOM ERROR MESSAGES Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable. Add <error> tags for each of the errors you want to handle.
"On" Always display custom (friendly) messages. "Off" Always display detailed ASP.NET error information. "RemoteOnly" Display custom (friendly) messages only to users not running on the local Web server. This setting is recommended for security purposes, so that you do not display application detail information to remote clients. --> <customErrors mode="Off" /> <!-- AUTHENTICATION This section sets the authentication policies of the application. Possible modes are "Windows", "Forms", "Passport" and "None"
"None" No authentication is performed. "Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to its settings for the application. Anonymous access must be disabled in IIS. "Forms" You provide a custom form (Web page) for users to enter their credentials, and then you authenticate them in your application. A user credential token is stored in a cookie. "Passport" Authentication is performed via a centralized authentication service provided by Microsoft that offers a single logon and core profile services for member sites. --> <authentication mode="Windows" /> <!-- AUTHORIZATION This section sets the authorization policies of the application. You can allow or deny access to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous (unauthenticated) users. --> <authorization> <allow users="?" /> </authorization> <!-- APPLICATION-LEVEL TRACE LOGGING Application-level tracing enables trace log output for every page within an application. Set trace enabled="true" to enable application trace logging. If pageOutput="true", the trace information will be displayed at the bottom of each page. Otherwise, you can view the application trace log by browsing the "trace.axd" page from your web application root. --> <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" /> <!-- SESSION STATE SETTINGS By default ASP.NET uses cookies to identify which requests belong to a particular session. If cookies are not available, a session can be tracked by adding a session identifier to the URL. To disable cookies, set sessionState cookieless="true". --> <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20" /> <!-- GLOBALIZATION This section sets the globalization settings of the application. --> <globalization requestEncoding="utf-8" responseEncoding="utf-8" /> </system.web> <location path="a2c.web"> <system.web> <authentication mode="Forms"> <forms loginUrl="login.aspx" name="adAuthCookie" path="/" /> </authentication> </system.web> </location>
Den spørger også efter nogle biblioteker som den nu tror ligger inde under a2c.web(den som jeg kaldte cms før). Jeg vil gerne beholde disse biblioteker ude i roden.
Bin ligger normalt i roden, hvor den buildede dll jo ligger.
Den bør ikke ligge andre steder, så vidt jeg ved.
Du skriver at du har to system.web filer, men jeg snakker hele tiden om web.config filen, der skal ligge i webroot.
Smutter til weekend nu og har ikke adgang til net hjemmefra, så hvis ikke du er kommet videre kan du lukke dette spg. og oprette et nyt, så en anden kan hjælpe.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.